/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --cream:  #F5F4F0;
  --ink:    #111111;
  --blue:   #2563EB;
  --muted:  #888884;
  --rule:   #E0DFDB;
  --chip-bg:#1A1A1A;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: #FFFFFF;
  background-image:
    radial-gradient(ellipse 72% 56% at 92% 4%,   rgba(37,99,235,0.14) 0%, transparent 65%),
    radial-gradient(ellipse 56% 48% at 6%  32%,  rgba(37,99,235,0.11) 0%, transparent 62%),
    radial-gradient(ellipse 50% 44% at 62% 66%,  rgba(37,99,235,0.08) 0%, transparent 56%),
    radial-gradient(ellipse 44% 38% at 24% 90%,  rgba(37,99,235,0.12) 0%, transparent 58%),
    radial-gradient(ellipse 60% 50% at 50% 45%,  rgba(37,99,235,0.05) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img   { display: block; max-width: 100%; }
ul    { list-style: none; }
a     { color: inherit; text-decoration: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
}

.nav__logo {
  display: flex;
  align-items: center;
}

.nav__logo-img {
  height: 56px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-right: 24px;
}

/* Nav link with Emil's grow-from-left underline */
.nav__link {
  position: relative;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink);
  cursor: pointer;
  padding-bottom: 3px;
  transition: color 200ms ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover {
    color: var(--blue);
  }
  .nav__link:hover::after {
    transform: scaleX(1);
  }
}

.nav__link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 2px;
  color: var(--blue);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: transparent;
  padding: 88px 48px 64px 48px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Brand: precise crop — left whitespace 388px, top 337px (natural).
   Display at 660px wide: left offset = 157px, top offset = 130px. */
.hero__brand {
  display: block;
  width: 380px;
  max-width: 100%;
  height: 107px;
  overflow: hidden;
}

.hero__logo {
  display: block;
  width: 660px;
  max-width: none;
  height: auto;
  margin-left: -157px;
  margin-top: -130px;
  animation: logo-enter 800ms var(--ease-out) both;
}

/* Display headline — Syne 800, ink, "forward." in blue */
.hero__headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: 24px;
  animation: text-enter 600ms var(--ease-out) 100ms both;
}

.hero__accent {
  color: var(--blue);
  font-style: normal;
}

/* Blue rule: grows from left — CSS-only */
.hero__rule {
  width: 48px;
  height: 2px;
  background: var(--blue);
  border: none;
  margin: 32px 0 24px;
  transform-origin: left;
  animation: rule-enter 500ms var(--ease-out) 220ms both;
}

.hero__subline {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  animation: text-enter 600ms var(--ease-out) 340ms both;
}

/* CTA button — ink on light page; active press feedback */
.hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 36px;
  height: 48px;
  padding: 0 32px;
  background: var(--ink);
  color: var(--cream);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 220ms var(--ease-out),
              color 220ms var(--ease-out),
              transform 160ms var(--ease-out);
  animation: text-enter 600ms var(--ease-out) 440ms both;
}

@media (hover: hover) and (pointer: fine) {
  .hero__btn:hover {
    background: var(--blue);
    color: var(--cream);
  }
}

.hero__btn:active {
  transform: scale(0.97);
}

.hero__btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  background: var(--blue);
  color: var(--cream);
}

/* ============================================================
   HERO LEFT / RIGHT COLUMNS
   ============================================================ */
.hero__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ============================================================
   HERO GFX — precision geometric SVG (right hero column)
   ============================================================ */
.hero-gfx {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  animation: text-enter 900ms var(--ease-out) 350ms both;
}

/* Outer ring: very slow clockwise */
.g-out-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: gfx-cw 110s linear infinite;
}

/* Mid dashed ring: slow counter-clockwise */
.g-mid-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: gfx-ccw 85s linear infinite;
}

/* Diamond polygon + blue nodes: slow clockwise */
.g-diamond-grp {
  transform-box: fill-box;
  transform-origin: center;
  animation: gfx-cw 75s linear infinite;
}

/* Inner square + corner dots: slow counter-clockwise */
.g-sq-grp {
  transform-box: fill-box;
  transform-origin: center;
  animation: gfx-ccw 55s linear infinite;
}

/* Core ring: pulses in/out */
.g-core-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: gfx-core-breathe 3.5s ease-in-out infinite;
}

/* Core dot: subtle pulse opposite phase */
.g-core-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: gfx-core-breathe 3.5s ease-in-out infinite reverse;
}

@keyframes gfx-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gfx-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

@keyframes gfx-core-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.9; }
  50%       { transform: scale(1.35); opacity: 0.35; }
}

/* ============================================================
   TICKER
   ============================================================ */
.ticker {
  background: var(--ink);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ticker__text {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--blue);
  white-space: nowrap;
  padding: 0 24px;
}

/* ============================================================
   SHARED SECTION LABEL
   ============================================================ */
.section-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--blue);
  text-transform: uppercase;
}

/* ============================================================
   WORK
   ============================================================ */
.work {
  background: transparent;
  padding: 96px 48px;
}

.work__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.work .section-label {
  margin-bottom: 64px;
  color: var(--blue);
}

.project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.project__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Project meta: index + year */
.project__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.project__num,
.project__year {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.project__name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 3.5vw, 48px);
  color: var(--ink);
  line-height: 1.05;
}

.project__desc {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 20px;
  max-width: 380px;
}

.project__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  display: inline-block;
  background: #E8E8E2;
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 0;
}

/* Project link: letter-spacing opens on hover (Emil) */
.project__link {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--blue);
  margin-top: 28px;
  cursor: pointer;
  letter-spacing: 0;
  transition: letter-spacing 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .project__link:hover {
    letter-spacing: 0.04em;
  }
}

.project__link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.project__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  /* clip-path is set by JS only — image is always visible without JS */
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  background: transparent;
  padding: 96px 48px;
}

.services__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.services .section-label {
  margin-bottom: 56px;
}

.services__list {
  display: flex;
  flex-direction: column;
}

/* Three-column editorial list: num | name | desc */
.service {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}

.services__list .service:last-child {
  border-bottom: 1px solid var(--rule);
}

.service__num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--blue);
  align-self: flex-start;
  padding-top: 6px;
}

/* Service name shifts 6px right on row hover — Emil's physical feedback */
.service__name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.5vw, 28px);
  color: var(--ink);
  line-height: 1.15;
  transition: transform 220ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .service:hover .service__name {
    transform: translateX(6px);
  }
}

.service__desc {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  background: transparent;
  padding: 96px 48px;
}

.contact__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.contact__headline {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 6.5vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.contact__sub {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
  line-height: 1.6;
}

.contact__form {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin-top: 56px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.form-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 16px 0;
  width: 100%;
  margin-bottom: 8px;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  transition: border-color 200ms ease;
}

.form-field-error {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #C0392B;
  padding-bottom: 24px;
}

.contact__form-error {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #C0392B;
  margin-bottom: 16px;
}

.contact__success {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--blue);
  text-transform: uppercase;
  padding: 24px 0;
}

.form-input::placeholder {
  color: #C4C3BF;
}

.form-input:focus {
  border-bottom-color: var(--ink);
}

/* Prevent iOS from adding inner shadow to textareas */
.form-textarea {
  height: 80px;
  resize: none;
  line-height: 1.6;
}

/* Submit button: ink/cream, active press feedback */
.contact__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  background: var(--ink);
  color: var(--cream);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  height: 48px;
  padding: 0 32px;
  border-radius: 0;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 200ms ease,
              transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .contact__submit:hover {
    background: var(--blue);
  }
}

.contact__submit:active {
  transform: scale(0.97);
}

.contact__submit:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  padding: 32px 48px;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copy,
.footer__url {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* ============================================================
   SCROLL REVEAL  (Intersection Observer in main.js)
   Emil: scale(0.98) + opacity — nothing appears from nothing
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 700ms var(--ease-out),
              transform 700ms var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

/* Logo: scale-in from 0.97 (feels physical, not magic) */
@keyframes logo-enter {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Text: subtle lift — 8px, not 16/24px (Emil: less is more) */
@keyframes text-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Blue rule: draws from left */
@keyframes rule-enter {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ============================================================
   REDUCED MOTION
   Fewer animations, not zero — opacity transitions remain
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__logo,
  .hero__headline,
  .hero__rule,
  .hero__subline,
  .hero__btn {
    animation: none;
    opacity: 1;
    transform: none;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* project__image: clip-path is JS-only, so no override needed here */

  .g-out-ring,
  .g-mid-ring,
  .g-diamond-grp,
  .g-sq-grp,
  .g-core-ring,
  .g-core-dot {
    animation: none;
  }

  .nav__link::after {
    transition: none;
  }

  .service__name,
  .project__link,
  .hero__btn,
  .contact__submit {
    transition: none;
  }
}

/* ============================================================
   RESPONSIVE — TABLET  ≤ 900px
   ============================================================ */
@media (max-width: 900px) {
  /* Hero: hide orbital, let text fill full width */
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__right {
    display: none;
  }

  /* Work: stack vertically, image above body */
  .project {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .project__image {
    order: -1;
  }

  .project__desc {
    max-width: none;
  }

  /* Services: stack number above name */
  .service {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 32px 0;
  }

  .service__num {
    padding-top: 0;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE  ≤ 640px
   ============================================================ */
@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .nav__inner {
    padding: 0 24px;
  }

  .nav__links {
    display: none;
  }

  .hero {
    padding: 100px 24px 72px;
    min-height: auto;
    align-items: flex-start;
  }

  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__right {
    display: none;
  }

  .hero__headline {
    font-size: clamp(32px, 9vw, 52px);
    margin-top: 20px;
  }

  .work,
  .services,
  .contact {
    padding: 64px 24px;
  }

  .footer {
    padding: 24px;
  }

  .contact__headline {
    font-size: clamp(40px, 10vw, 64px);
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
