/* KarvInteractive
   Layout idea: the black and white mark stays neutral, every project brings its own colour.
   The 22 degree slant between the A and the V of the logo is the one shape used for
   buttons, image pairs and panels, always separated by the logo's hairline gap. */

:root {
  color-scheme: dark;

  /* Studio neutrals */
  --ink: #070914;
  --soot: #10131f;
  --soot-2: #1b2031;
  --bone: #f1f3f8;
  --ash: #a8b0c4;
  --text-2: #c9d0de;
  --rule: rgba(226, 233, 248, .16);

  /* World colours: the nebula of the studio ident, and the lamp light of the rain capture */
  --cobalt: #0d1c66;
  --cobalt-lit: #2446c9;
  --lamp: #f2d9a6;
  --ice: #cddaec;
  --ice-ink: #0c1733;
  --navy: #0a1024;
  --alert: #6b1d2c;

  /* Type */
  --display: 'League Spartan', 'Futura', 'Century Gothic', 'Trebuchet MS', sans-serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --step-0: 1.0625rem;
  --step-1: clamp(1.2rem, 1.05rem + .6vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.3vw, 2.4rem);
  --step-3: clamp(2.5rem, 1.6rem + 3.8vw, 5rem);
  --step-4: clamp(2.6rem, .8rem + 10vw, 10.5rem);

  --gutter: clamp(20px, 4.4vw, 72px);
  --gap: 4px;              /* the hairline between KA and RV */
  --lean: .408;            /* tan of the logo slant */
  --section: clamp(72px, 10vw, 152px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--bone);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 4px; }
::selection { background: var(--cobalt-lit); color: #fff; }

.wrap { width: 100%; max-width: 1640px; margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 100; background: var(--bone); color: var(--ink); padding: 12px 18px; font-weight: 600; }
.skip:focus { top: 16px; }

.h-big, .h-mid {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: -.025em; line-height: .86; text-wrap: balance;
}
.h-big { font-size: var(--step-4); letter-spacing: -.035em; line-height: .82; }
.h-mid { font-size: var(--step-3); }
.lead { font-size: var(--step-1); line-height: 1.45; text-wrap: pretty; }
.small { font-size: .9rem; }
.dim { color: var(--ash); }
.text-link { font-weight: 600; text-underline-offset: .28em; text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.text-link:hover { text-decoration-color: var(--lamp); }

/* Buttons: two trapezoids that lock together like the A and the V */
.pair { display: inline-flex; flex-wrap: wrap; row-gap: 10px; }
.b {
  --h: 56px; --s: calc(var(--h) * var(--lean));
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--h); padding: 0 calc(var(--s) + 12px) 0 26px;
  border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-weight: 600; font-size: 1rem; line-height: 1;
  background: var(--bone); color: var(--ink);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--s)) 100%, 0 100%);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.b:hover { background: var(--lamp); }
.b:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--cobalt-lit); }
.b-v {
  background: rgba(226, 233, 248, .16); color: var(--bone);
  padding: 0 26px 0 calc(var(--s) + 12px);
  margin-left: calc(var(--s) * -1 + var(--gap) * 1.2);
  clip-path: polygon(var(--s) 0, 100% 0, 100% 100%, 0 100%);
}
.b-v:hover { background: rgba(226, 233, 248, .3); color: #fff; }
.b-v:focus-visible { box-shadow: inset 0 0 0 3px var(--lamp); }
.on-ice .b { background: var(--ice-ink); color: #fff; }
.on-ice .b:hover { background: #1d3166; }
@media (max-width: 480px) {
  .pair { display: flex; flex-wrap: nowrap; }
  .b { white-space: normal; text-align: center; line-height: 1.15; font-size: .96rem; min-width: 0; padding: 0 calc(var(--s) + 6px) 0 16px; }
  .b-v { padding: 0 16px 0 calc(var(--s) + 6px); }
}
.b[disabled] { opacity: .55; cursor: progress; }

/* ---------- Header ---------- */
.top {
  position: fixed; inset: 0 0 auto; z-index: 40;
  transition: background-color .3s var(--ease), opacity .9s var(--ease);
}
.top::before {
  content: ""; position: absolute; inset: 0 0 -60px; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(7, 9, 20, .78), transparent);
  transition: opacity .3s;
}
.top.solid { background: var(--ink); }
.top.solid::before { opacity: 0; }
.top-in { display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); min-height: 88px; }
.brand { display: block; padding: 9px 0; flex: none; }
.brand img { width: auto; height: 70px; }
.menu { display: flex; gap: clamp(16px, 2.3vw, 36px); }
.menu a { text-decoration: none; font-weight: 600; font-size: .97rem; padding: 12px 0; position: relative; }
.menu a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px;
  background: var(--lamp); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.menu a:hover::after, .menu a[aria-current]::after { transform: scaleX(1); }
@media (min-width: 821px) {
  .menu { flex: 1; align-items: center; }
  .menu .menu-extra { --h: 42px; --s: calc(var(--h) * var(--lean)); margin-left: auto; padding: 0 20px 0 calc(var(--s) + 14px); line-height: var(--h); background: rgba(226, 233, 248, .16); clip-path: polygon(var(--s) 0, 100% 0, 100% 100%, 0 100%); transition: background-color .25s var(--ease), color .25s; }
  .menu .menu-extra::after { content: none; }
  .menu .menu-extra:hover, .menu .menu-extra[aria-current] { background: var(--bone); color: var(--ink); }
  .menu .menu-extra:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px var(--lamp); }
}
.burger { display: none; }

@media (max-width: 820px) {
  .burger {
    display: grid; place-items: center; width: 48px; height: 48px; margin-left: auto; margin-right: -10px;
    background: none; border: 0; cursor: pointer; position: relative; z-index: 2;
  }
  .burger i { grid-area: 1 / 1; width: 28px; height: 3px; background: var(--bone); transition: transform .3s var(--ease); }
  .burger i:first-child { transform: translateY(-5px); }
  .burger i:last-child { transform: translateY(5px); }
  .burger[aria-expanded="true"] i:first-child { transform: rotate(45deg); }
  .burger[aria-expanded="true"] i:last-child { transform: rotate(-45deg); }
  .brand { position: relative; z-index: 2; }
  .menu {
    position: fixed; inset: 0; z-index: 1; background: var(--cobalt);
    flex-direction: column; justify-content: flex-end; gap: 0; padding: 100px var(--gutter) 44px;
    visibility: hidden; clip-path: inset(0 0 100% 0);
    transition: clip-path .45s var(--ease), visibility 0s .45s;
  }
  .menu.open { visibility: visible; clip-path: inset(0); transition: clip-path .45s var(--ease); }
  .menu a { font: 800 clamp(2.6rem, 13vw, 4rem)/1 var(--display); text-transform: uppercase; letter-spacing: -.03em; padding: 10px 0 2px; align-self: flex-start; }
  .menu a::after { bottom: 2px; height: 4px; }
  .menu-open { overflow: hidden; }
}

/* ---------- Opening: the mark as a window ---------- */
.intro { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.intro svg { width: 100%; height: 100%; }
.intro path { fill: var(--ink); fill-rule: evenodd; }
.intro .tint { fill: rgba(44, 92, 235, .62); }
html.intro-on body::before { content: ""; position: fixed; inset: 0; z-index: 89; background: var(--ink); animation: intro-failsafe 0s 2.5s forwards; }
html.intro-drawn body::before { display: none; }
html.intro-on :is(.hero-in, .top) { opacity: 0; }
html.intro-on .hero::before { opacity: .25; }
.hero-in, .hero::before { transition: opacity .9s var(--ease); }
@keyframes intro-failsafe { to { visibility: hidden; } }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: min(92svh, 1040px); display: flex; overflow: clip; background: var(--ink); }
.hero-art { position: absolute; inset: 0; z-index: -3; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-art .nebula { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s linear; }
.hero-art .nebula.on { opacity: 1; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 -1px; z-index: -2;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(7, 9, 20, .6) 20%, transparent 46%),
    linear-gradient(to right, rgba(7, 9, 20, .62), transparent 58%);
}
.hero-in { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 20px; padding-top: 140px; padding-bottom: clamp(120px, 15vh, 168px); }
.status { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; }
.status::before { content: ""; width: 22px; height: 14px; background: var(--lamp); clip-path: polygon(26% 0, 74% 0, 100% 100%, 0 100%); }
.h-hero { font: 800 clamp(2.9rem, 1rem + 6.6vw, 8.4rem)/.84 var(--display); letter-spacing: -.035em; text-transform: uppercase; max-width: 11ch; }
.hero .lead { max-width: 36ch; margin-bottom: 8px; }
.cap { font-size: .85rem; color: var(--ash); }

@media (max-width: 820px) {
  .hero { min-height: 92svh; }
  .hero::before { background: linear-gradient(to top, var(--ink) 8%, rgba(7, 9, 20, .86) 36%, rgba(7, 9, 20, .4) 54%, transparent 70%); }
  .hero-in { gap: 14px; padding-bottom: 104px; }
}

/* ---------- News ---------- */
.news { position: relative; z-index: 2; margin-top: -72px; padding-bottom: var(--section); }
.news .h-mid { font-size: var(--step-2); }
.row-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 44px); }
.news-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--gap); min-height: 320px; align-items: stretch; }
.news-grid.solo { grid-template-columns: minmax(0, 1fr); }
.n-lead, .n-row { display: grid; text-decoration: none; background: var(--soot); transition: background-color .3s var(--ease); min-width: 0; }
.n-lead:hover, .n-row:hover { background: var(--soot-2); }
.n-img { overflow: hidden; background: var(--cobalt); }
.n-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
a:hover > .n-img img { transform: scale(1.04); }
.n-lead { grid-template-rows: auto 1fr; }
.n-lead .n-img { aspect-ratio: 16 / 9; }
.n-lead .n-txt { padding: clamp(22px, 2.6vw, 40px); align-content: start; }
.n-lead h3 { font: 700 var(--step-2)/1.04 var(--display); letter-spacing: -.02em; }
.n-rows { display: grid; gap: var(--gap); grid-auto-rows: 1fr; min-width: 0; }
.n-row { grid-template-columns: minmax(96px, 30%) minmax(0, 1fr); }
.n-row .n-img { min-height: 132px; position: relative; }
.n-row .n-img img { position: absolute; inset: 0; }
.n-row .n-txt { padding: clamp(16px, 1.6vw, 26px); align-content: center; }
.n-row h3 { font: 700 var(--step-1)/1.1 var(--display); letter-spacing: -.015em; }
.n-txt { display: grid; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.n-meta { font-size: .88rem; color: var(--ash); font-weight: 500; }
.n-meta b { color: var(--lamp); font-weight: 600; margin-right: 10px; }
.n-txt p:last-child { color: var(--text-2); }
.n-note { grid-column: 1 / -1; background: var(--soot); padding: 48px var(--gutter); display: grid; place-items: center; text-align: center; }
.n-skel { background: linear-gradient(100deg, var(--soot) 40%, var(--soot-2) 50%, var(--soot) 60%) 0 / 220% 100%; animation: skel 1.6s linear infinite; min-height: 320px; }
@keyframes skel { to { background-position: -220% 0; } }
.chips { display: flex; flex-wrap: wrap; gap: var(--gap); }
.chip { background: var(--soot); border: 0; min-height: 44px; padding: 0 20px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.chip:hover { background: var(--soot-2); }
.chip[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
@media (max-width: 900px) { .news-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Cobalt bands ---------- */
.band { background: var(--cobalt); padding-block: var(--section); }
.stack { display: grid; gap: 28px; justify-items: start; align-content: start; min-width: 0; }
.stack .lead { max-width: 40ch; }
/* ---------- Studio, on ice blue ---------- */
.ice { background: var(--ice); color: var(--ice-ink); padding-block: var(--section); }
.ice .split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(36px, 6vw, 110px); align-items: center; }
.ice .h-mid { font-size: clamp(2.6rem, 1.2rem + 5.4vw, 6.6rem); }
.ice .lead { max-width: 46ch; }
.ident { width: 100%; aspect-ratio: 1; object-fit: cover; background: #0a1024; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 4vw, 72px); margin-top: clamp(48px, 6vw, 96px); }
.facts h3 { font: 700 var(--step-1)/1.1 var(--display); letter-spacing: -.01em; margin-bottom: 8px; }
@media (max-width: 900px) { .ice .split { grid-template-columns: minmax(0, 1fr); } .facts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Community: three locked panels ---------- */
.comm { padding-block: var(--section); }
.panels { --s: 0px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { min-height: 420px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(24px, 2.6vw, 44px); background: var(--soot); text-decoration: none; transition: background-color .35s var(--ease); }
.panel svg { width: 56px; height: 56px; }
.panel h3 { font: 800 var(--step-2)/.95 var(--display); letter-spacing: -.025em; margin-bottom: 10px; }
.panel p { color: var(--text-2); max-width: 30ch; }
.panel:hover { background: var(--cobalt); }
.panel:focus-visible { outline: 0; box-shadow: inset 0 0 0 4px var(--lamp); }
@media (min-width: 901px) {
  .panels { --s: clamp(64px, 8.3vw, 132px); }
  .panel { min-height: 460px; }
  .panel:nth-child(1) { clip-path: polygon(0 0, 100% 0, calc(100% - var(--s)) 100%, 0 100%); padding-right: calc(var(--s) + 20px); margin-right: calc(var(--s) / -2 + 3px); }
  .panel:nth-child(2) { clip-path: polygon(var(--s) 0, calc(100% - var(--s)) 0, 100% 100%, 0 100%); margin-inline: calc(var(--s) / -2 + 3px); padding-inline: calc(var(--s) + 12px); text-align: center; align-items: center; }
  .panel:nth-child(3) { clip-path: polygon(0 0, 100% 0, 100% 100%, var(--s) 100%); padding-left: calc(var(--s) + 20px); margin-left: calc(var(--s) / -2 + 3px); text-align: right; align-items: flex-end; }
}
@media (max-width: 900px) { .panels { grid-template-columns: minmax(0, 1fr); gap: var(--gap); } .panel { min-height: 230px; } }

/* ---------- Inner page heads ---------- */
.head { padding: clamp(150px, 19vw, 250px) 0 clamp(40px, 5vw, 80px); }
.head .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34ch); gap: 24px 64px; align-items: end; }
.head .lead { padding-bottom: .4em; }
@media (max-width: 900px) { .head .wrap { grid-template-columns: minmax(0, 1fr); } }
.body-pad { padding-bottom: var(--section); }

/* ---------- Full width captures ---------- */
.plate { position: relative; }
.plate img { width: 100%; height: min(78svh, 46vw); min-height: 320px; object-fit: cover; }
.plate .cap { position: absolute; left: 0; right: 0; bottom: 20px; color: var(--bone); text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }

/* ---------- Studio page ---------- */
.night { background: var(--navy); }
.night-head { padding-top: clamp(128px, 12vw, 180px); padding-bottom: var(--section); }
.night-head .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: end; }
.prose { display: grid; gap: 1.1em; max-width: 64ch; }
.prose.lead { max-width: 48ch; }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 4vw, 64px) clamp(28px, 5vw, 88px); }
.values h3 { font: 800 var(--step-2)/1 var(--display); letter-spacing: -.02em; margin-bottom: 8px; }
.values p { color: var(--text-2); max-width: 34ch; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 110px); }
.pad { padding-block: var(--section); }
@media (max-width: 900px) { .night-head .wrap, .values, .two { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Article ---------- */
.article { padding: clamp(120px, 12vw, 170px) 0 var(--section); }
.article header { display: grid; gap: 18px; margin: 36px 0 clamp(28px, 4vw, 56px); }
.article h1 { font: 800 clamp(2.4rem, 1.4rem + 4.4vw, 5.6rem)/.92 var(--display); letter-spacing: -.03em; text-wrap: balance; max-width: 18ch; overflow-wrap: anywhere; }
.article .cover { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; margin-bottom: clamp(32px, 4vw, 64px); }
.article-body { max-width: 66ch; font-size: 1.15rem; line-height: 1.7; overflow-wrap: anywhere; }
.article-body > * + * { margin-top: 1.1em; }
.article-body ul, .article-body ol { padding-left: 1.2em; list-style: revert; }
.article-body img { height: auto; }
.article .by { color: var(--ash); font-weight: 500; }
.article .clip { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; margin-bottom: clamp(32px, 4vw, 64px); }
.clip.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.clips { display: grid; gap: clamp(20px, 3vw, 40px); margin-top: clamp(32px, 4vw, 64px); }
.clips .clip { margin: 0; }
.n-video { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; color: var(--bone); font-weight: 600; }
.n-video::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--lamp); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--gap); margin-top: clamp(32px, 4vw, 64px); }
.shots img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---------- Contact ---------- */
.contact { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(40px, 6vw, 120px); align-items: start; }
/* A slow cobalt glow behind the card */
.contact::before { content: ""; position: absolute; z-index: -1; left: -8%; top: -10%; width: 72%; height: 110%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(36, 70, 201, .42), rgba(36, 70, 201, .12) 55%, transparent); filter: blur(30px); animation: breathe 9s ease-in-out infinite alternate; }
@keyframes breathe { from { transform: translate(0, 0) scale(1); opacity: .8; } to { transform: translate(4%, 3%) scale(1.08); opacity: 1; } }
.contact-card {
  --cut: clamp(18px, 2.4vw, 36px); --drop: calc(var(--cut) / var(--lean));
  position: relative; min-width: 0; padding: clamp(24px, 4vw, 56px);
  background: rgba(16, 19, 33, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--drop), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--drop)));
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.contact-card.is-leaving .form { opacity: 0; transform: translateY(-12px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 22px; }
.form > .f { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.f { display: grid; gap: 10px; align-content: start; min-width: 0; border: 0; margin: 0; padding: 0; }
.f.full { grid-column: 1 / -1; }
.f label, .f legend { font-weight: 600; padding: 0; }
.ctl { position: relative; }
.ctl .line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--lamp); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease), background-color .2s; pointer-events: none; }
.ctl:focus-within .line { transform: scaleX(1); }
.ctl:has([aria-invalid="true"]) .line { transform: scaleX(1); background: #e2736b; }
.f input, .f textarea { display: block; width: 100%; min-height: 56px; padding: 15px 18px; background: rgba(7, 9, 20, .62); border: 0; border-bottom: 2px solid #4a5476; border-radius: 0; font-size: 1.06rem; transition: background-color .25s; }
.f textarea { min-height: 190px; resize: vertical; line-height: 1.55; }
.f :is(input, textarea):focus-visible { outline: 0; background-color: rgba(7, 9, 20, .9); }
.f ::placeholder { color: #8c96ad; opacity: 1; transition: color .3s; }
.err { color: #f3a39c; font-size: .92rem; }
.err:empty { display: none; }

/* Topic cards: the selected one fills with a slanted wipe */
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.topic { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: center; padding: 18px 20px; min-height: 84px; background: rgba(7, 9, 20, .62); cursor: pointer; transition: background-color .25s, transform .25s var(--ease); }
.topic:hover { background: rgba(27, 32, 49, .95); }
.topic:active { transform: scale(.985); }
.topic::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, var(--cobalt-lit), var(--cobalt) 70%); clip-path: polygon(0 0, 0 0, -45% 100%, 0 100%); transition: clip-path .55s var(--ease); }
.topic.is-on::before { clip-path: polygon(0 0, 145% 0, 100% 100%, 0 100%); }
.topic input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.topic:has(input:focus-visible) { outline: 2px solid var(--lamp); outline-offset: 2px; }
.topic-mark { width: 22px; height: 20px; background: #3a4363; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); transition: background-color .25s, transform .4s var(--ease); }
.topic.is-on .topic-mark { background: var(--lamp); animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }
.topic b { font: 700 1.15rem/1.15 var(--display); letter-spacing: -.01em; }
.topic-sub { grid-column: 2; font-size: .92rem; color: var(--text-2); line-height: 1.35; }
.topic.is-on .topic-sub { color: #dfe6ff; }
.topics[aria-invalid="true"] .topic { box-shadow: inset 0 -2px 0 #e2736b; }

/* Message length */
.msg-foot { display: flex; align-items: center; gap: 14px; font-size: .86rem; color: var(--ash); font-variant-numeric: tabular-nums; }
.msg-meter { flex: 1; height: 2px; background: var(--soot-2); overflow: hidden; }
.msg-meter i { display: block; height: 100%; background: var(--cobalt-lit); transform: scaleX(0); transform-origin: left; transition: transform .2s linear, background-color .2s; }
.msg-foot.near { color: var(--lamp); }
.msg-foot.near .msg-meter i { background: var(--lamp); }

.check { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; align-items: center; font-weight: 400 !important; cursor: pointer; min-height: 44px; }
.f .check input { width: 26px; height: 26px; min-height: 0; padding: 0; accent-color: var(--lamp); }

/* Send: the button fills while the message is on its way */
.send { position: relative; isolation: isolate; min-width: 220px; --fill: 0; --dur: 0ms; }
.send::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--lamp); transform: scaleX(var(--fill)); transform-origin: left; transition: transform var(--dur) linear; }
.send.is-sending { cursor: progress; }
.send.is-sending .send-label::after { content: "..."; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; clip-path: inset(0 100% 0 0); }
@keyframes dots { to { clip-path: inset(0 -10% 0 0); } }
.b[disabled].send { opacity: 1; }

.form-msg { grid-column: 1 / -1; padding: 18px 22px; background: var(--alert); font-weight: 500; animation: rise .4s var(--ease) both; }
.shake { animation: shake .42s var(--ease); }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }

/* Confirmation */
.sent { display: grid; justify-items: start; gap: 22px; padding-block: clamp(8px, 2vw, 24px); outline: 0; }
.contact-card.is-sent .sent { animation: wipe .7s var(--ease) both; }
@keyframes wipe { from { clip-path: polygon(0 0, 0 0, -40% 100%, 0 100%); } to { clip-path: polygon(0 0, 140% 0, 100% 100%, 0 100%); } }
.sent > :not(svg) { animation: rise .6s var(--ease) both; }
.sent > :nth-child(2) { animation-delay: .25s; }
.sent > :nth-child(3) { animation-delay: .35s; }
.sent > :nth-child(4) { animation-delay: .45s; }
.sent-signal { width: 150px; height: 150px; overflow: visible; }
.sent-signal .ring { fill: none; stroke: var(--lamp); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: 0; animation: ring 2.4s var(--ease) 2; }
.sent-signal .ring:nth-child(2) { animation-delay: .4s; }
.sent-signal .ring:nth-child(3) { animation-delay: .8s; }
@keyframes ring { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.5); } }
.sent-signal .core { fill: var(--lamp); transform-box: fill-box; transform-origin: center; animation: pop .6s var(--ease) .15s both; }
.sent-signal .tick { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: square; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s var(--ease) .45s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.aside { display: grid; gap: 36px; }
.aside h2 { font: 700 var(--step-1)/1.1 var(--display); margin-bottom: 8px; }
.aside p { color: var(--text-2); max-width: 38ch; }
.mail { font: 700 clamp(1.15rem, .9rem + .9vw, 1.6rem)/1.2 var(--display); overflow-wrap: anywhere; }
.trap { position: absolute; left: -9999px; }
@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } .contact::before { width: 100%; height: 70%; } }
@media (max-width: 560px) {
  .form, .topic-grid { grid-template-columns: minmax(0, 1fr); }
  .topic { min-height: 0; padding: 16px 18px; }
  .send { min-width: 0; width: 100%; }
}

/* ---------- 404 ---------- */
.lost { position: relative; isolation: isolate; min-height: 100svh; display: flex; background: #05070f; }
.lost > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.lost::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(7, 9, 20, .94), rgba(7, 9, 20, .25) 70%); }
.lost .stack { align-content: end; padding-block: 140px 80px; gap: 20px; }

/* ---------- Footer: a card floating on the nebula ---------- */
.foot { position: relative; isolation: isolate; padding: clamp(64px, 9vw, 140px) 0 26px; background: var(--ink) url(../media/nebula-1920.webp) 38% 78% / cover no-repeat; }
.foot::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--ink), rgba(7, 9, 20, .5) 34%, rgba(7, 9, 20, .28) 66%, rgba(7, 9, 20, .72)); }
/* Corners cut at the slant of the logo's A and V */
.foot-card {
  --cut: clamp(18px, 2.4vw, 38px); --drop: calc(var(--cut) / var(--lean));
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px clamp(32px, 6vw, 104px);
  padding: clamp(28px, 4.4vw, 68px);
  background: rgba(8, 11, 24, .9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--drop), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--drop)));
}
.foot-brand { display: grid; gap: 26px; justify-items: start; align-content: start; min-width: 0; }
.foot-mark { width: clamp(150px, 15vw, 230px); aspect-ratio: 1; object-fit: cover; }
.foot-tag { font: 700 clamp(1.3rem, 1rem + 1vw, 1.85rem)/1.12 var(--display); letter-spacing: -.015em; max-width: 21ch; text-wrap: balance; }
.foot-nav { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr) minmax(0, .85fr); grid-template-areas: "studio touch follow"; gap: 36px clamp(20px, 3vw, 48px); align-content: start; }
.foot-nav > :nth-child(1) { grid-area: studio; }
.foot-nav > :nth-child(2) { grid-area: touch; }
.foot-nav > :nth-child(3) { grid-area: follow; }
.foot-nav h2 { font: 700 1.05rem/1.2 var(--display); letter-spacing: .01em; margin-bottom: 12px; }
.foot-nav ul { display: grid; gap: 2px; }
.foot-nav a { display: inline-flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--text-2); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; transition: color .2s; }
.foot-nav a:hover { color: var(--bone); text-decoration: underline; text-decoration-color: var(--lamp); text-underline-offset: .3em; text-decoration-thickness: 2px; }
.foot-nav .mail { font: inherit; font-weight: 500; }
.foot-social svg { width: 20px; height: 20px; flex: none; }
.foot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding-top: 24px; color: var(--text-2); font-size: .92rem; }
.foot-bar p:first-child { margin-right: auto; }
.to-top { font-weight: 600; text-decoration: none; padding: 10px 0; color: var(--bone); }
.to-top:hover { color: var(--lamp); }
@media (max-width: 960px) {
  .foot-card { grid-template-columns: minmax(0, 1fr); }
  .foot-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "studio follow" "touch touch"; gap: 28px 24px; }
}
@media (max-width: 420px) {
  .foot-bar p:first-child { margin-right: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
