/* ==========================================================================
   Dynexar — landing page
   ========================================================================== */

:root {
  --accent: #F2501D;     /* brand colour — change here */
  --bg: #000;
  --line: #1c1b1b;       /* grid lines */
  --text: #fff;
  --muted: #5d5d5d;
  --gap: 0.19rem;        /* grid line thickness */

  --font-display: "Squada One", "Arial Narrow", sans-serif;
  --font-logo: "Arvo", Georgia, serif;
  --font-body: "Montserrat", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 1rem scales with the viewport: the whole layout fits one screen */
html {
  font-size: min(1.5625vw, 2.75vh);
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 812px) {
  html { font-size: 2.6vh; }
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
button { cursor: pointer; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 1px dashed var(--accent);
  outline-offset: 0.3rem;
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */

.dx-wrapper {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 1.5rem;
}

.dx-grid {
  display: flex;
  width: 100%;
  height: 100%;
  padding: calc(var(--gap) / 2);
  background: var(--line);
}

.dx-part {
  display: flex;
  flex-wrap: wrap;
  align-content: stretch;
}

.dx-part--left   { width: 25%; flex-wrap: nowrap; }
.dx-part--center { width: 50%; }
.dx-part--right  { flex: 1; }

.dx-col {
  display: flex;
  flex-direction: column;
  width: 50%;
}

.dx-cell {
  position: relative;
  width: var(--w, 100%);
  height: var(--h, 100%);
  /* the black block sits inside the line-coloured grid → gap reads as a line */
  border: calc(var(--gap) / 2) solid var(--line);
  background: var(--bg);
  background-clip: padding-box;
  opacity: 0;
  animation: dx-cell-in 0.9s cubic-bezier(.2, .7, .2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes dx-cell-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* Empty cells react to the cursor with a short accent glow (see script.js) */
.dx-cell--fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.dx-cell--fx.is-lit::after {
  opacity: 0.14;
  transition-duration: 0.12s;
}

/* --------------------------------------------------------------------------
   Main block
   -------------------------------------------------------------------------- */

.dx-main {
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
}

.dx-logo {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-left: -4.5rem;          /* figure centre sits on the left grid line */
  transition: opacity 0.2s;
}

.dx-logo:hover { opacity: 0.85; }

.dx-logo__figure {
  width: 3rem;
  height: 3rem;
  margin-right: 1rem;
  flex: none;
  transition: transform 0.6s cubic-bezier(.3, 1.4, .5, 1);
}

.dx-logo__figure polygon {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 3;
  transition: fill 0.3s, stroke 0.3s;
}

.dx-logo:hover .dx-logo__figure { transform: rotate(60deg); }

.dx-logo__text {
  font-family: var(--font-logo);
  font-size: 0.85rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.dx-title {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: auto;
  font-weight: 400;
  font-size: 4.4rem;
  line-height: 0.98;
  letter-spacing: 0.01em;
}

.dx-title span {
  display: block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: dx-rise 0.9s cubic-bezier(.2, .7, .2, 1) forwards;
}

.dx-title span:nth-child(1) { animation-delay: 0.45s; }
.dx-title span:nth-child(2) { animation-delay: 0.6s; }
.dx-title span:nth-child(3) { animation-delay: 0.75s; }

@keyframes dx-rise {
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Footer row
   -------------------------------------------------------------------------- */

.dx-copyright {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  padding: 0 3rem;
  font-family: var(--font-body);
}

.dx-person {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 1.2rem;
  row-gap: 0.2rem;
}

.dx-person__name {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.dx-person__email {
  position: relative;
  font-size: 0.72rem;
  white-space: nowrap;
  color: var(--text);
  transition: color 0.25s;
}

.dx-person__email::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.2rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(.7, 0, .2, 1);
}

.dx-person__email:hover { color: var(--accent); }
.dx-person__email:hover::after { transform: none; }

.dx-copyright__text {
  font-size: 0.55rem;
  color: var(--muted);
}

.dx-contact-cell {
  display: flex;
}

.dx-contact {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  overflow: hidden;
  transition: color 0.3s;
}

.dx-contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.45s cubic-bezier(.7, 0, .2, 1);
}

.dx-contact:hover::before,
.dx-contact[aria-expanded="true"]::before { transform: none; }

.dx-contact__text { position: relative; }

.dx-contact__figure {
  position: relative;
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.4s;
}

/* arrow drawn with two strokes */
.dx-contact__figure::before,
.dx-contact__figure::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.dx-contact__figure::before {        /* shaft */
  left: 0; right: 0; top: 50%;
  height: 1.5px;
  transform: translateY(-50%);
}

.dx-contact__figure::after {         /* head */
  right: 0; top: 50%;
  width: 0.45rem; height: 0.45rem;
  background: none;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}

.dx-contact:hover .dx-contact__figure { transform: translateX(0.25rem); }
.dx-contact[aria-expanded="true"] .dx-contact__figure { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
   Contact popup (fills the main block)
   -------------------------------------------------------------------------- */

.dx-popup {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  padding: 2.5rem 3rem;
  background: var(--accent);
  clip-path: inset(100% 0 0 0);
  visibility: hidden;
  transition: clip-path 0.55s cubic-bezier(.7, 0, .2, 1), visibility 0s 0.55s;
}

.is-open .dx-popup {
  clip-path: inset(0 0 0 0);
  visibility: visible;
  transition: clip-path 0.55s cubic-bezier(.7, 0, .2, 1), visibility 0s;
}

/* logo turns into an outlined "close" button while the popup is open */
.is-open .dx-logo__figure polygon {
  fill: var(--bg);
  stroke: var(--text);
}

.is-open .dx-title { visibility: hidden; transition: visibility 0s 0.3s; }

.dx-form,
.dx-form__done {
  width: 100%;
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

.dx-form__title {
  font-weight: 400;
  font-size: 2.2rem;
  line-height: 1;
}

.dx-form__info {
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
}

.dx-form__group {
  display: flex;
  gap: 2rem;
}

.dx-form__field { flex: 1; }

.dx-form__input {
  width: 100%;
  padding: 0.6rem 0;
  font-family: var(--font-body);
  font-size: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  transition: border-color 0.2s;
}

.dx-form__input::placeholder { color: rgba(255, 255, 255, 0.75); }
.dx-form__input:focus { border-color: #fff; }
.dx-form__input.is-invalid { border-color: #000; }

.dx-form__submit {
  align-self: center;
  width: 11rem;
  padding: 1.1rem 0;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: #000;
  background: #fff;
  transition: background 0.25s, color 0.25s;
}

.dx-form__submit:hover { background: #000; color: #fff; }
.dx-form__submit:disabled { opacity: 0.6; cursor: wait; }

/* --------------------------------------------------------------------------
   Mobile: only the centre column stays
   -------------------------------------------------------------------------- */

@media (max-width: 812px) {
  .dx-wrapper { padding: 1rem; }
  .dx-part--left,
  .dx-part--right { display: none; }
  .dx-part--center { width: 100%; }

  .dx-main { padding: 1.5rem; }
  .dx-logo { margin-left: 0; }
  .dx-title { font-size: min(3.2rem, 14.5vw); }

  .dx-copyright { --w: 62% !important; padding: 0 1rem; gap: 0.5rem; }
  .dx-person { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; row-gap: 0.35rem; }
  .dx-person__name { font-size: 0.85rem; }
  .dx-person__email { font-size: 0.62rem; }
  .dx-copyright__text { font-size: 0.5rem; }
  .dx-contact-cell { --w: 38% !important; }
  .dx-contact { font-size: 0.62rem; gap: 0.5rem; }

  .dx-popup { padding: 1.5rem; }
  .dx-form, .dx-form__done { margin-top: 4.5rem; gap: 1.8rem; }
  .dx-form__group { flex-direction: column; gap: 1rem; }
  .dx-form__input { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
