/* =========================================================
   Creative CTRL - homepage
   Shape rule: surfaces, keys and inputs use --r (14px),
   small keycaps scale down to 7-9px, buttons and tags are pills.
   One accent (electric cobalt). Theme follows the system, with a toggle.
   ========================================================= */

:root {
  --bg: #0c0c0b;
  --bg-2: #151513;
  --bg-3: #1f1f1c;
  --ink: #ecece8;
  --ink-2: #a3a39c;
  --ink-3: #6b6b65;
  --line: rgb(236 236 232 / 0.13);
  --accent: #2e5bff;          /* electric cobalt */
  --accent-ink: #8ea6ff;      /* accent used as text, AA on bg */
  --field: 236 236 232;       /* mouse field lines (rgb triplets) */
  --field-hi: 120 150 255;
  --on-accent: #f7f8ff;
  --key-top: #22221f;
  --key-side: #050504;
  --key-ink: #ecece8;
  --shadow: rgb(0 0 0 / 0.45);

  --f-display: "Archivo", system-ui, sans-serif;
  --f-body: "Geist", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, monospace;

  --r: 14px;
  --gutter: clamp(20px, 5.5vw, 96px);
  --section: clamp(140px, 22vh, 260px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ededea;
    --bg-2: #e2e2de;
    --bg-3: #d6d6d1;
    --ink: #11110f;
    --ink-2: #54544e;
    --ink-3: #8a8a83;
    --line: rgb(17 17 15 / 0.14);
    --accent-ink: #2342d6;
    --field: 17 17 15;
    --field-hi: 46 91 255;
    --key-top: #fafaf8;
    --key-side: #b4b4ad;
    --key-ink: #11110f;
    --shadow: rgb(40 40 30 / 0.22);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ededea;
  --bg-2: #e2e2de;
  --bg-3: #d6d6d1;
  --ink: #11110f;
  --ink-2: #54544e;
  --ink-3: #8a8a83;
  --line: rgb(17 17 15 / 0.14);
  --accent-ink: #2342d6;
  --field: 17 17 15;
  --field-hi: 46 91 255;
  --key-top: #fafaf8;
  --key-side: #b4b4ad;
  --key-ink: #11110f;
  --shadow: rgb(40 40 30 / 0.22);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
/* grain, fixed and non-interactive */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
kbd { font-family: var(--f-mono); }

.display {
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.display em { font-style: italic; font-weight: 700; }

.section-title { font-size: clamp(2.6rem, 6.4vw, 6.6rem); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 22px;
}

.media-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.86);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.5s var(--ease);
}
.link:hover { background-size: 0% 1px; background-position: 100% 100%; }
.link i { transition: transform 0.4s var(--ease); }
.link:hover i { transform: translate(2px, -2px); }

/* ---------- Keycap (the brand device) ---------- */
.key {
  --depth: 6px;
  position: relative;
  background: var(--key-top);
  color: var(--key-ink);
  border-radius: var(--r);
  box-shadow:
    0 var(--depth) 0 var(--key-side),
    0 calc(var(--depth) + 12px) 26px -10px var(--shadow),
    inset 0 1px 0 rgb(255 255 255 / 0.07);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background-color 0.3s;
}
.key.is-pressed,
.ctrl-held .key {
  transform: translateY(calc(var(--depth) - 1px));
  box-shadow:
    0 1px 0 var(--key-side),
    0 4px 10px -6px var(--shadow),
    inset 0 1px 0 rgb(255 255 255 / 0.05);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s var(--ease), color 0.35s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn--lg { height: 56px; padding: 0 28px; font-size: 16px; }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--ghost { box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: var(--bg); }
.btn__roll { position: relative; display: inline-block; transition: transform 0.5s var(--ease); }
.btn__roll::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: calc(100% + 1.4em);
}
.btn:hover .btn__roll { transform: translateY(calc(-100% - 1.4em)); }
.btn { line-height: 1.2; }
.magnetic { display: inline-flex; }

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  animation: loader-failsafe 0.01s 5s forwards;
}
.loader__inner { display: flex; align-items: center; gap: 18px; }
.loader__word {
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.loader__key {
  --depth: 8px;
  padding: 18px 30px;
  font-family: var(--f-mono);
  font-size: 22px;
  transition: box-shadow 0.12s ease-in; /* movement is animated in script.js */
}
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }
html:not(.js) .loader { display: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  transition: background-color 0.4s;
}
/* Always on top and transparent. .on-media switches it to light ink over dark media. */
.nav.on-media:not(.is-open) {
  --ink: #f2f2ee;
  --line: rgb(242 242 238 / 0.3);
  color: var(--ink);
}
.nav { color: var(--ink); }
.nav .logo__word, .nav .theme-toggle { color: var(--ink); transition: color 0.4s var(--ease); }

.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.logo__word {
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.03em;
}
.logo__key {
  --depth: 3px;
  border-radius: 7px;
  padding: 4px 8px 3px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: -3px;
}
.nav__links { display: flex; gap: 34px; }
.nav__links a {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.4s var(--ease), opacity 0.3s;
}
.nav__links:hover a:not(:hover) { opacity: 0.55; }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 18px;
  transition: transform 0.5s var(--ease);
}
.theme-toggle:hover { transform: rotate(180deg); }
.nav__menu { display: none; width: 44px; height: 44px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.nav__menu span {
  position: absolute; left: 14px; right: 14px; height: 1.5px; background: var(--ink);
  transition: transform 0.4s var(--ease);
}
.nav__menu span:first-child { top: 18px; }
.nav__menu span:last-child { top: 25px; }
.nav.is-open .nav__menu span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__menu span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 899px) {
  .nav__links {
    position: fixed;
    inset: 72px 0 auto;
    flex-direction: column;
    gap: 0;
    padding: 12px var(--gutter) 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.6s var(--ease);
  }
  .nav.is-open .nav__links { clip-path: inset(0 0 0 0); }
  .nav.is-open { background: var(--bg); }
  .nav__links a {
    font-family: var(--f-display);
    font-stretch: 112%;
    font-weight: 700;
    font-size: 34px;
    letter-spacing: -0.03em;
    color: var(--ink);
    padding: 10px 0;
  }
  .nav__menu { display: block; }
  .nav__cta { display: none; }
}

/* ---------- Hero: one static screen, CTRL cut out of the page colour ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; }
/* the screen's own colour shows through the letter holes */
.hero__screen { position: absolute; inset: 0; overflow: hidden; background-color: var(--ink); }
.hero__maskwrap { position: absolute; inset: 0; }
.hero__mask { display: block; width: 100%; height: 100%; }
.mask-fill { fill: var(--bg); transition: fill 0.5s var(--ease); }
.mask-text {
  font-family: var(--f-display);
  font-weight: 900;
  font-stretch: 125%;
  letter-spacing: -0.02em;
}
.hero__creative {
  position: absolute;
  left: var(--gutter);
  top: 18vh;
  font-family: var(--f-display);
  font-stretch: 112%;
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 34px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.hero__copy {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  padding: 0 var(--gutter) clamp(28px, 6vh, 64px);
}
.hero__title { font-size: clamp(2.1rem, 4.3vw, 4.4rem); }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero__title .line > span { display: block; }
.hero__sub { margin-top: 18px; max-width: 46ch; color: var(--ink-2); font-size: clamp(16px, 1.2vw, 18px); }
.hero__ctas { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .hero__copy { grid-template-columns: 1fr; gap: 24px; }
  .hero__ctas .btn--lg { height: 52px; padding: 0 22px; }
}

/* ---------- About ---------- */
.about { padding: var(--section) var(--gutter); }
.about__grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 3fr;
  gap: clamp(40px, 8vw, 160px);
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
}
.about__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-3);
  margin-top: 0.6em;
}
.about__text {
  font-size: clamp(1.9rem, 4vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.about__text em { padding-right: 0.06em; }
.about__foot {
  margin-top: clamp(56px, 7vw, 104px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  color: var(--ink-2);
}
.about__foot p { max-width: 44ch; }
.about__foot .link { color: var(--ink); }
@media (max-width: 760px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__media { width: 62%; }
}

/* ---------- Services (keyboard) ---------- */
.services { padding: clamp(96px, 14vh, 160px) var(--gutter) var(--section); max-width: 1700px; margin: 0 auto; }
.services__hint { margin-top: 24px; color: var(--ink-2); }
@media (hover: none) { .services__hint { display: none; } }
.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: clamp(18px, 2.2vw, 36px);
  margin-top: clamp(64px, 10vh, 120px);
}
.key-slot--wide { grid-column: span 2; }
.key-card {
  --depth: 8px;
  min-height: clamp(250px, 31vh, 330px);
  height: 100%;
  padding: clamp(24px, 2.4vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
  cursor: default;
}
.key-card:hover {
  transform: translateY(calc(var(--depth) - 1px));
  box-shadow: 0 1px 0 var(--key-side), 0 4px 10px -6px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.05);
}
.key-card__cap {
  position: relative;
  z-index: 1;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.key-card:hover .key-card__cap,
.key-card.is-pressed .key-card__cap { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.key-card > div:last-child { position: relative; z-index: 1; }
.key-card__title { font-size: clamp(1.55rem, 2.1vw, 2.2rem); letter-spacing: -0.03em; }
.key-card p { margin-top: 12px; max-width: 36ch; font-size: 15.5px; color: var(--ink-2); }

.key-card--img { color: #ecece8; }
.key-card--img p { color: rgb(236 236 232 / 0.8); }
.key-card--img .key-card__cap { box-shadow: inset 0 0 0 1px rgb(236 236 232 / 0.3); }
.key-card__bg { position: absolute; inset: 0; }
.key-card__bg img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(0.7);
  transform: scale(1.02);
  transition: transform 1.2s var(--ease), filter 0.8s;
}
.key-card__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(10 10 9 / 0.15), rgb(10 10 9 / 0.72));
}
.key-card--img:hover .key-card__bg img { transform: scale(1.07); filter: grayscale(0.6) contrast(1.05) brightness(0.75); }

.key-card--accent { background: var(--accent); color: var(--on-accent); --key-side: #1a3bc4; }
.key-card--accent p { color: rgb(247 248 255 / 0.82); }
.key-card--accent .key-card__cap { box-shadow: inset 0 0 0 1px rgb(247 248 255 / 0.35); }
.key-card--accent:hover .key-card__cap,
.key-card--accent.is-pressed .key-card__cap { background: var(--on-accent); color: var(--accent); }

@media (max-width: 1023px) { .keys { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .keys { grid-template-columns: 1fr; }
  .key-slot--wide { grid-column: auto; }
  .key-card { min-height: 220px; }
}

/* ---------- Case studies (horizontal) ---------- */
.work { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.work__track {
  display: flex;
  align-items: center;
  gap: clamp(80px, 9vw, 180px);
  width: max-content;
  height: 100vh;
  height: 100svh;
  padding: 0 var(--gutter);
  will-change: transform;
}
.work__intro { flex: none; width: min(32vw, 520px); }
.work__lead { margin-top: 28px; max-width: 34ch; color: var(--ink-2); font-size: 18px; }
.case {
  flex: none;
  width: min(76vw, 1260px);
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(36px, 4.5vw, 80px);
  align-items: end;
}
.case__media {
  position: relative;
  display: block;
  height: min(64svh, 680px);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-3);
}
.case__media img {
  position: absolute;
  top: 0;
  left: -8%;
  width: 116%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.85);
  transition: filter 0.8s var(--ease);
}
.case__media:hover img { filter: grayscale(0.2) contrast(1.04) brightness(0.92); }
.case__sector { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.case__title { margin-top: 14px; font-size: clamp(2.6rem, 4.8vw, 5.4rem); }
.case__text { margin-top: 22px; max-width: 34ch; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 28px 0 36px; }
.tags li { font-size: 13px; padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.work__progress {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(20px, 4vh, 40px);
  height: 1px;
  background: var(--line);
}
.work__progress span { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }

@media (max-width: 899px) {
  .work__track {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    height: auto;
    padding: var(--section) var(--gutter);
    gap: 112px;
  }
  .work__intro, .case { width: auto; }
  .case { grid-template-columns: 1fr; }
  .case__media { height: auto; aspect-ratio: 4 / 5; }
  .case__media img { left: 0; width: 100%; }
  .work__progress { display: none; }
}
@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  .work__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; }
  .case, .work__intro { scroll-snap-align: start; }
}

/* ---------- Gallery ---------- */
.gallery { padding: var(--section) var(--gutter); max-width: 1700px; margin: 0 auto; }
.gallery__lead { margin-top: 28px; max-width: 46ch; color: var(--ink-2); font-size: 18px; }
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(72px, 8vw, 136px) clamp(28px, 3vw, 52px);
  margin-top: clamp(72px, 11vh, 136px);
}
.gitem { display: block; text-decoration: none; }
.gitem__media {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-3);
}
.gitem__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.9);
  transition: transform 0.9s var(--ease), filter 0.6s var(--ease);
}
.gitem:hover .gitem__media img { transform: scale(1.04); filter: grayscale(0.2) contrast(1.04) brightness(0.95); }
.gitem__title { display: block; margin-top: 24px; font-size: clamp(1.25rem, 1.8vw, 1.75rem); font-weight: 600; letter-spacing: -0.01em; }
.gitem__sub { display: block; margin-top: 6px; font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
/* an odd last item takes the full row instead of sitting alone */
.gitem:last-child:nth-child(odd) { grid-column: 1 / -1; }
.gitem:last-child:nth-child(odd) .gitem__media { aspect-ratio: 21 / 9; }
@media (max-width: 600px) {
  .gallery__grid { grid-template-columns: 1fr; }
  .gitem:last-child:nth-child(odd) .gitem__media { aspect-ratio: 4 / 3; }
}

/* ---------- Contact ---------- */
.contact { padding-top: clamp(40px, 8vh, 80px); }
.marquee {
  display: block;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: clamp(14px, 2vh, 24px) 0;
  text-decoration: none;
}
.marquee__inner { display: flex; width: max-content; will-change: transform; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding-right: 0.35em;
  font-size: clamp(3.6rem, 10vw, 10.5rem);
  white-space: nowrap;
  transition: color 0.4s;
}
.marquee__item i { color: var(--accent-ink); font-size: 0.5em; }
.marquee:hover .marquee__item { color: var(--accent-ink); }
.marquee:hover .marquee__item i { color: var(--ink); }

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(64px, 9vw, 180px);
  padding: var(--section) var(--gutter);
  max-width: 1600px;
  margin: 0 auto;
}
.contact__intro .section-title { font-size: clamp(2.4rem, 4.8vw, 5rem); }
.contact__lead { margin-top: 28px; max-width: 42ch; color: var(--ink-2); font-size: 18px; }
.contact__mail {
  display: inline-block;
  margin-top: 40px;
  font-size: clamp(1.4rem, 2.4vw, 2.4rem);
  text-decoration: none;
  letter-spacing: -0.03em;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0% 3px no-repeat;
  padding-bottom: 6px;
  transition: background-size 0.6s var(--ease);
}
.contact__mail:hover { background-size: 100% 3px; }
.socials { display: flex; gap: 24px; list-style: none; margin-top: 28px; }
.socials a { color: var(--ink-2); text-decoration: none; transition: color 0.3s; }
.socials a:hover { color: var(--ink); }

.form__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; margin-bottom: 30px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  transition: border-color 0.25s, box-shadow 0.25s;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--accent-ink); }
.select { position: relative; }
.select i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink-2); }
.field__help { font-size: 13.5px; color: var(--ink-2); }
.field__error { font-size: 13.5px; color: var(--accent-ink); min-height: 0; }
.field__error:empty { display: none; }
.form__submit[disabled] { opacity: 0.7; pointer-events: none; }

.form-success { align-self: center; }
.form-success i { font-size: 44px; color: var(--accent-ink); }
.form-success__title { margin-top: 18px; font-size: clamp(2.2rem, 4vw, 3.8rem); }
.form-success__text { margin-top: 14px; color: var(--ink-2); font-size: 18px; }

@media (max-width: 899px) {
  .contact__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .form__fields { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.footer { padding: 0 var(--gutter) 28px; overflow: hidden; }
.footer__mark {
  display: flex;
  align-items: baseline;
  gap: 0.18em;
  font-size: clamp(2.6rem, 12.6vw, 14rem);
  line-height: 0.82;
  letter-spacing: -0.05em;
  padding-top: 0.1em;
  white-space: nowrap;
}
.footer__mark span:first-child { font-weight: 300; }
.footer__ctrl { font-stretch: 125%; font-weight: 900; transition: color 0.3s; }
.ctrl-held .footer__ctrl { color: var(--accent-ink); }
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.footer__row .link { color: var(--ink); }
.footer__note kbd {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--line), 0 2px 0 var(--line);
  color: var(--ink);
}
@media (hover: none) { .footer__note { display: none; } }

/* ---------- Slot notes (open with ?slots) ---------- */
.show-slots [data-slot] { outline: 1px dashed var(--accent); outline-offset: -1px; }
.show-slots [data-slot]::after {
  content: attr(data-slot);
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 6;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgb(12 12 11 / 0.88);
  color: #ecece8;
  font: 500 12px/1.45 var(--f-mono);
}


/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .loader { display: none; }
}

/* =========================================================
   v2 additions
   ========================================================= */

/* ---------- Mouse field ---------- */
.mfield { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.mfield--page { position: fixed; z-index: 0; }
main, .footer { position: relative; z-index: 1; }
@media (hover: none) { .mfield--page { display: none; } }

/* ---------- Kinetic titles ---------- */
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.sc { display: inline-block; will-change: transform; }

/* ---------- Sector keys ---------- */
.sector-keys { display: flex; flex-wrap: wrap; gap: 12px 12px; list-style: none; }
.sector-key {
  --depth: 5px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: default;
  user-select: none;
}
.sector-key i { font-size: 19px; color: var(--accent-ink); }
.sector-key:hover {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--key-side), 0 4px 10px -6px var(--shadow), inset 0 1px 0 rgb(255 255 255 / 0.05);
}

/* ---------- Service keys: tilt + spotlight ---------- */
.key-slot { transform-style: preserve-3d; }
.key-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.key-card:hover::after { opacity: 1; }
.key-card--accent::after { background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / 0.22), transparent 65%); }

/* ---------- Chaos -> CTRL board ---------- */
.control {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  --h-forest: #1e3b30;
  --h-fog: #dfe6e1;
  --h-plum: #6b2d43;
  --h-paper: #f3f5f3;
}
.control__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4.5vh, 52px);
  padding: 104px var(--gutter) clamp(32px, 6vh, 64px);
  max-width: 1700px;
  margin: 0 auto;
}
.control__title { font-size: clamp(2.3rem, 5.4vw, 5.8rem); white-space: nowrap; }
.control__title .scramble { display: inline-block; min-width: 1ch; }
.control__lead { margin-top: 14px; max-width: 52ch; color: var(--ink-2); font-size: 17px; }
.control__note { margin-top: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }

.board {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  grid-template-areas:
    "photo photo logo   logo  book book"
    "photo photo swatch extra book book"
    "room  room  cal    cal   pay  pay"
    "room  room  cal    cal   mail key";
  gap: clamp(12px, 1.5vw, 22px);
}
.board__grid {
  position: absolute;
  inset: -10px 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: inherit;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.board__grid span {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-inline: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
}
.bit { position: relative; min-height: 0; min-width: 0; will-change: transform; }
.bit__in {
  position: relative;
  height: 100%;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 24px 48px -22px rgb(0 0 0 / 0.55);
  will-change: transform;
}
.bit img { width: 100%; height: 100%; object-fit: cover; }

.bit--photo { grid-area: photo; }
.bit--photo img { filter: grayscale(0.15) contrast(1.04); }

.bit--logo { grid-area: logo; }
.bit--logo .bit__in { background: var(--h-fog); color: var(--h-forest); display: grid; place-content: center; text-align: center; gap: 6px; }
.halden { font-family: var(--f-display); font-stretch: 62%; font-weight: 300; letter-spacing: 0.42em; font-size: clamp(22px, 2.6vw, 44px); line-height: 1; padding-left: 0.42em; }
.halden__sub { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; }

.bit--swatch { grid-area: swatch; }
.bit--swatch .bit__in { display: grid; grid-template-rows: 1.4fr 1fr 1fr; }
.bit--swatch span { background: var(--c); }

.bit--book { grid-area: book; }
.bit--book .bit__in {
  background: var(--h-forest);
  color: var(--h-fog);
  padding: clamp(12px, 1.4vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 10px);
  min-height: 0;
}
.book__title { font-family: var(--f-display); font-stretch: 62%; font-size: clamp(18px, 1.6vw, 26px); font-weight: 500; letter-spacing: 0.02em; }
.book__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.book__row > div { border: 1px solid rgb(223 230 225 / 0.22); border-radius: 10px; padding: clamp(5px, 0.8vh, 8px) 12px; }
.book__row span { display: block; font-size: 11px; opacity: 0.65; }
.book__row b { font-weight: 500; font-size: 14px; }
.book__btn {
  margin-top: auto;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(8px, 1.2vh, 12px) 16px;
  border-radius: 999px;
  background: var(--h-fog);
  color: var(--h-forest);
  font-weight: 600;
  font-size: 14px;
}

.bit--key { grid-area: key; }
.bit--key .bit__in {
  background: var(--h-plum);
  color: var(--h-fog);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}
.halden--sm { font-size: 15px; letter-spacing: 0.36em; }
.kc__nfc { font-size: 28px; opacity: 0.6; transform: rotate(90deg); }
.kc__room { font-family: var(--f-display); font-stretch: 62%; font-weight: 300; font-size: clamp(36px, 3.6vw, 60px); line-height: 0.9; }

/* booking pieces */
.bit--extra { grid-area: extra; }
.bit--extra .bit__in { background: var(--h-paper); color: var(--h-forest); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.extra__name { font-weight: 600; font-size: 13.5px; }
.extra__price { font-family: var(--f-display); font-stretch: 62%; font-size: clamp(20px, 1.8vw, 28px); line-height: 1.1; }
.extra__price small { display: block; font-family: var(--f-body); font-size: 11px; opacity: 0.6; }
.extra__toggle { margin-top: auto; width: 38px; height: 22px; border-radius: 999px; background: rgb(30 59 48 / 0.2); position: relative; }
.extra__toggle span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.3s var(--ease); }
.extra__toggle.is-on { background: var(--h-forest); }
.extra__toggle.is-on span { transform: translateX(16px); }

.bit--room { grid-area: room; }
.bit--room .bit__in { background: var(--h-paper); color: var(--h-forest); display: flex; flex-direction: column; }
.bit--room img { flex: 1; min-height: 0; }
.room__body { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 12px 14px 14px; }
.room__name { font-family: var(--f-display); font-stretch: 62%; font-weight: 600; font-size: clamp(17px, 1.5vw, 24px); letter-spacing: 0.02em; }
.room__meta { font-size: 12px; opacity: 0.65; margin-top: 2px; }
.room__buy { text-align: right; flex: none; }
.room__price { font-weight: 600; font-size: 15px; }
.room__price small { font-weight: 400; opacity: 0.6; font-size: 11px; }
.room__sel { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 5px 10px; border-radius: 999px; background: var(--h-forest); color: var(--h-fog); font-size: 12px; font-weight: 600; }

.bit--cal { grid-area: cal; }
.bit--cal .bit__in { background: var(--h-fog); color: var(--h-forest); padding: clamp(12px, 1.4vw, 18px); display: flex; flex-direction: column; gap: 8px; }
.cal__head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.cal__nav { display: flex; gap: 10px; opacity: 0.6; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal__wd { font-family: var(--f-mono); font-size: 10.5px; opacity: 0.55; }
.cal__days { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); row-gap: 3px; line-height: 1; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cal__days span { display: grid; place-items: center; }
.cal__days span:first-child { grid-column: 1; }
.cal__days .off { opacity: 0.3; text-decoration: line-through; }
.cal__days .mid { background: rgb(30 59 48 / 0.14); }
.cal__days .in, .cal__days .out { background: var(--h-forest); color: var(--h-fog); font-weight: 600; }
.cal__days .in { border-radius: 999px 0 0 999px; }
.cal__days .out { border-radius: 0 999px 999px 0; }

.bit--pay { grid-area: pay; }
.bit--pay .bit__in { background: #141c18; color: var(--h-fog); padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 18px; }
.pay__lines p { display: flex; justify-content: space-between; font-size: 12.5px; opacity: 0.75; line-height: 1.6; }
.pay__lines .pay__total { opacity: 1; font-weight: 600; font-size: 14px; border-top: 1px solid rgb(223 230 225 / 0.18); margin-top: 3px; padding-top: 3px; }
.pay__btn { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 13px; }

.bit--mail { grid-area: mail; }
.bit--mail .bit__in { background: var(--h-paper); color: #1d2420; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.mail__from { display: flex; align-items: center; gap: 5px; font-family: var(--f-mono); font-size: 10.5px; opacity: 0.7; }
.mail__from i { font-size: 14px; color: var(--h-forest); }
.mail__subj { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.mail__prev { font-size: 12px; opacity: 0.7; line-height: 1.35; }

@media (max-width: 899px) {
  .control__inner { padding-top: 84px; gap: 16px; }
  .control__title { white-space: normal; font-size: clamp(2rem, 9vw, 3.2rem); }
  .control__lead { font-size: 15.5px; }
  .board {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 0.5fr auto 1.5fr 0.45fr;
    grid-template-areas: "logo swatch" "book book" "room cal" "pay pay";
  }
  .board__grid { grid-template-columns: repeat(2, 1fr); }
  .board__grid span:nth-child(n + 3) { display: none; }
  .bit--photo, .bit--extra, .bit--mail, .bit--key, .book__row--2, .room__meta, .cal__nav, .pay__lines p:not(.pay__total) { display: none; }
  .bit--cal .bit__in { padding: 10px; gap: 4px; }
  .cal__head { font-size: 12.5px; }
  .cal__days { font-size: 11px; row-gap: 1px; }
  .bit--pay .bit__in { align-items: center; }
  .pay__lines .pay__total { border: 0; margin: 0; padding: 0; }
  .room__body { flex-direction: column; align-items: flex-start; }
  .room__buy { text-align: left; }
}

/* ---------- v3: media fallbacks ---------- */
.about__media > * { position: absolute; inset: 0; }
/* an empty <video> renders black in Safari: hide it until it has a source */
video.media-cover:not([src]):not(:has(source)) { display: none; }

/* ---------- Thumbnail -> case study zoom (transition.js) ---------- */
.zoom { position: fixed; inset: 0; z-index: 45; pointer-events: auto; }
.zoom__back { position: absolute; inset: 0; background: #0c0c0b; opacity: 0; }
.zoom__box { position: absolute; overflow: hidden; background: #0c0c0b; will-change: transform, filter; }
.zoom__ghost { transform-origin: 50% 50%; }
.zoom__img { position: absolute; max-width: none; object-fit: cover; }
.zoom__scrim, .chero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgb(8 8 7 / 0.78) 0%, rgb(8 8 7 / 0.28) 38%, rgb(8 8 7 / 0) 62%),
    linear-gradient(to bottom, rgb(8 8 7 / 0.42) 0%, rgb(8 8 7 / 0) 22%);
}
.zoom__scrim { opacity: 0; }

/* ---------- Gallery pop-up (popup.js) ---------- */
.pop { position: fixed; inset: 0; z-index: 60; background: var(--bg); }
.pop[hidden] { display: none; }
.pop__scroll { position: absolute; inset: 0; z-index: 1; overflow-y: auto; overscroll-behavior: contain; }
.pop .mfield--pop { position: absolute; z-index: 0; }
.pop .mfield--pophero { z-index: 0; }
.pop__head { z-index: 1; }
.pop__hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: #0c0c0b; color: #f2f2ee; }
.pop__hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pop__head { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(40px, 9vh, 96px); }
.pop__sub { font-family: var(--f-mono); font-size: 13px; color: rgb(242 242 238 / 0.78); }
.pop__title { margin-top: 16px; font-size: clamp(3rem, 9vw, 10rem); line-height: 0.92; letter-spacing: -0.045em; }
.pop .cw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.pop .cw > span { display: inline-block; }
.pop__body {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2.4fr;
  gap: clamp(32px, 8vw, 160px);
  padding: clamp(96px, 16vh, 200px) var(--gutter);
  max-width: 1700px;
  margin: 0 auto;
}
.pop__label { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.pop__text { font-size: clamp(1.5rem, 2.8vw, 3rem); line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; max-width: 30ch; }
.pop__photos { display: grid; gap: 10px; padding-bottom: 10px; }
.pop__photo { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-3); }
.pop__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pop__body, .pop__photo { opacity: 0; transform: translateY(48px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.pop__body.is-in, .pop__photo.is-in { opacity: 1; transform: none; }
.pop__close {
  position: fixed;
  top: 14px;
  right: var(--gutter);
  z-index: 2;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgb(12 12 11 / 0.55);
  color: #f2f2ee;
  font-size: 20px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgb(242 242 238 / 0.25);
  cursor: pointer;
  transition: transform 0.5s var(--ease), background-color 0.3s;
}
.pop__close:hover { transform: rotate(90deg); background: var(--accent); }
.pop__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) { .pop__body { grid-template-columns: 1fr; gap: 20px; } }
@media (prefers-reduced-motion: reduce) { .pop__body, .pop__photo { opacity: 1; transform: none; } }
