/* ── Day (default) ─────────────────────────── */
:root {
  /* fonts & motion */
  --f: "Inter Tight", "Noto Sans JP", "Noto Sans KR", sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.35, 0.5, 1); /* slight overshoot */

  /* brand (same in both themes) */
  --star: #c4121c;

  /* surfaces */
  --bg: #f5f2ee;
  --card: #ece5df;
  --scr: #f7f3eecc; /* translucent overlay / scrim */

  /* text */
  --ink: #6b0a0c;
  --dim: #a07370;
  --soft: #e7c3bf;

  /* lines & pills */
  --line: #6b0a0c1c;
  --pill: #6b0a0c;
  --pillInk: #f5f2ee;

  /* texture */
  --grainBlend: multiply;
  --haze: 0.17;

  /* color ramp (light → dark) */
  --w0: #ff6a55;
  --w1: #e0141f;
  --w2: #8e0b10;
  --w3: #6b0a0c;
  --w4: #6b0a0c;
}

/* ── Night ─────────────────────────────────── */
[data-theme="night"] {
  /* surfaces */
  --bg: #000;
  --card: #0e0e0e;
  --scr: #0a0a0acc;

  /* text */
  --ink: #f5f5f4;
  --dim: #8a8a87;
  --soft: #4b2226;

  /* lines & pills */
  --line: #ffffff14;
  --pill: #111111e6;
  --pillInk: #f5f5f4;

  /* texture */
  --grainBlend: overlay;
  --haze: 0.6;

  /* color ramp */
  --w0: #fff4ef;
  --w1: #ff7a5c;
  --w2: #ff2a1a;
  --w3: #2a0906;
  --w4: #141414;
}

/* ── Base ──────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip; /* stars and glows poke past the sides; never allow sideways scrolling */
  scrollbar-width: none; /* default scrollbar hidden; .sb (below) replaces it */
}
html::-webkit-scrollbar {
  display: none;
}

/* custom scrollbar: a thin rail, a fill that follows scroll progress, a star riding the tip.
   Back at the top the fill springs shut and the star spins (.reset). Built by common.js */
.sb {
  position: fixed;
  right: 10px;
  top: 12vh;
  bottom: 12vh;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
  z-index: 70;
  pointer-events: none;
}
.sb-fill {
  position: absolute;
  inset: 0;
  background: var(--star);
  border-radius: 2px;
  transform-origin: top;
  transform: scaleY(var(--p, 0));
  transition: transform 0.5s var(--ease);
}
.sb-star {
  position: absolute;
  left: 50%;
  top: calc(var(--p, 0) * 100%);
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  transition: top 0.5s var(--ease);
  rotate: calc(var(--p, 0) * 720deg);
}
.sb-star svg {
  display: block;
  width: 100%;
  height: 100%;
}
.sb.reset .sb-fill {
  transition-duration: 0.9s;
  transition-timing-function: cubic-bezier(0.5, 1.8, 0.4, 1); /* overshoots like a spring */
}
.sb.reset .sb-star {
  transition-duration: 0.9s;
  transition-timing-function: cubic-bezier(0.5, 1.8, 0.4, 1);
  animation: sbpop 0.9s var(--ease);
}
@keyframes sbpop {
  50% {
    scale: 1.9;
    filter: drop-shadow(0 0 6px var(--star));
  }
}
@media (max-width: 700px) {
  .sb {
    display: none;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition:
    background 0.7s,
    color 0.7s;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  all: unset;
  box-sizing: border-box; /* all: unset wipes the global border-box too */
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--w1);
  outline-offset: 4px;
}

::selection {
  background: var(--w1);
  color: #fff;
}

.jp {
  font-size: 0.82em;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.px {
  --px-min: 40px;
  padding-inline: 40px;
}

/* film grain over everything */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: var(--grainBlend);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Poster type ───────────────────────────── */
.pt {
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.03em; /* tighter than ~-.03em shows seams between letters */
  text-transform: uppercase;
}

.soft {
  white-space: nowrap; /* keeps the * glued to its word; they're separate inline-blocks, so a narrow column would otherwise wrap them */
  color: var(--soft);
  transition: color 0.7s;
}

/* the * around each pink word: js/main.js sets --r from the scroll position, so they spin as you scroll */
.ast {
  display: inline-block;
  font-style: normal;
  transform: rotate(var(--r, 0deg));
  transform-origin: 50% 40%; /* the * glyph sits high in its box, so pivot on the glyph, not the box */
}

/* blur-in reveal: js/main.js adds .in when the line scrolls into view */
.ln {
  display: block;
  opacity: 0;
  transform: translateY(0.3em);
  filter: blur(18px);
  transition:
    opacity 0.9s var(--ease),
    transform 1.1s var(--ease),
    filter 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}

.ln.in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ── Blurred stars ─────────────────────────── */
.star {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.star .fl {
  width: 100%;
  height: 100%;
  animation: float var(--dur, 10s) ease-in-out infinite alternate;
}

.star svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

@keyframes float {
  from {
    transform: translate(0, 0) rotate(0);
  }
  to {
    transform: translate(2vw, -3vh) rotate(26deg);
  }
}

/* cursor star */
.cur {
  position: fixed;
  left: 0;
  top: 0;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  z-index: 85;
  pointer-events: none;
  filter: blur(9px);
  opacity: 0.7;
  transition:
    width 0.4s var(--ease),
    height 0.4s var(--ease),
    margin 0.4s var(--ease),
    opacity 0.3s;
}

.cur.big {
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
  opacity: 0.4;
}

/* ── Header ────────────────────────────────── */
.hdr {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding-top: 24px;
}

/* blur strip behind the navbar: two stacked layers (light + heavy) that fade out downward so there is
   no visible edge. Hidden at the top of the page, fades in once you scroll (js toggles .scrolled) */
.hdr::before,
.hdr::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: -1; /* behind the logo / menu / button */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.hdr::before {
  height: 130px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
}

.hdr::after {
  height: 92px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: linear-gradient(
    color-mix(in srgb, var(--bg) 60%, transparent),
    transparent
  ); /* a little tint so the nav stays readable */
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
  mask-image: linear-gradient(#000 40%, transparent);
}

.hdr.scrolled::before,
.hdr.scrolled::after {
  opacity: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 48px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.brand svg {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible; /* the halves fly outside the box during the animation */
}

/* logo loop (6s): rests, then the mark does one smooth turn (it draws in slightly as it spins, like a coin) while a
   thin ring draws itself around it, completes the circle, and wipes away. The ring is the <circle class="lring"> in
   each page's header svg. Reduce-motion leaves the ring hidden (its resting state is "not drawn"). */
.logo {
  animation: logo-turn 6s infinite;
}
.logo .lring {
  fill: none;
  stroke-dasharray: 1; /* pathLength="1": one dash = the whole circle, so the offset runs 1 → 0 → -1 */
  stroke-dashoffset: 1;
  transform-box: fill-box;
  transform-origin: center;
  rotate: -90deg; /* start drawing from the top */
  animation: logo-ring 6s infinite;
}

@keyframes logo-turn {
  0%,
  60% {
    transform: rotate(0) scale(1);
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  }
  72% {
    transform: rotate(180deg) scale(0.84);
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  }
  86%,
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes logo-ring {
  0%,
  60% {
    stroke-dashoffset: 1;
    opacity: 1;
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  }
  80% {
    stroke-dashoffset: 0; /* circle complete */
    opacity: 1;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  94%,
  100% {
    stroke-dashoffset: -1; /* wipes away in the same direction it was drawn */
    opacity: 0.4;
  }
}

.brand span {
  display: inline-block;
  min-width: 3.6em; /* stops the header jumping while imba morphs to シンバ */
}

/* admin shortcut: after hovering the logo for a moment a glass pill springs out under it (common.js builds it) */
.adm-pop {
  position: absolute;
  z-index: 81;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--pillInk);
  border: 1px solid #ffffff1f;
  box-shadow:
    0 14px 34px -12px #0007,
    0 0 26px -10px var(--w1);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  filter: blur(6px);
  translate: 0 -10px;
  scale: 0.85;
  transform-origin: 18px -6px;
  transition:
    opacity 0.25s,
    filter 0.35s,
    translate 0.5s var(--spring),
    scale 0.5s var(--spring),
    background 0.25s,
    visibility 0s 0.35s;
}
/* little notch pointing up at the logo */
.adm-pop::before {
  content: "";
  position: absolute;
  left: 16px;
  top: -5px;
  width: 9px;
  height: 9px;
  rotate: 45deg;
  background: inherit;
  border-left: 1px solid #ffffff1f;
  border-top: 1px solid #ffffff1f;
  border-radius: 2px 0 0 0;
}
.adm-pop svg {
  width: 14px;
  height: 14px;
  color: var(--w1);
  transition: transform 0.45s var(--spring);
}
.adm-pop .arr {
  opacity: 0;
  margin-left: -6px;
  transition:
    opacity 0.25s,
    margin 0.4s var(--spring);
}
.adm-pop.on {
  opacity: 1;
  visibility: visible;
  filter: none;
  translate: 0;
  scale: 1;
  transition-delay: 0s;
}
.adm-pop:hover {
  background: var(--pill);
}
.adm-pop:hover svg:first-child {
  transform: rotate(-12deg) scale(1.15);
}
.adm-pop:hover .arr {
  opacity: 0.8;
  margin-left: 0;
}

/* right side of the header: always-visible theme switch + the Get in touch button */
.hdr-r {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tswitch {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--pill);
  color: var(--pillInk);
  border: 1px solid #ffffff12;
  backdrop-filter: blur(16px);
  transition:
    transform 0.35s var(--ease),
    background 0.7s;
}

.tswitch:hover {
  transform: rotate(18deg) scale(1.06);
}

.tswitch svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  transition:
    transform 0.6s var(--ease),
    opacity 0.4s;
}

/* shows a sun in Day and a moon in Night: they swap with a little spin */
[data-theme="day"] .t-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.3);
}
[data-theme="night"] .t-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.3);
}

/* small dot while the theme is following the device (Auto) */
.tswitch[data-mode="auto"]::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--w1);
  box-shadow: 0 0 0 2px var(--pill);
}

.cta {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pillInk);
  font-weight: 600;
  transition:
    transform 0.3s var(--ease),
    background 0.7s;
}

.cta:hover {
  transform: scale(1.04);
}

.cta b {
  font-size: 13px;
  transition: transform 0.5s var(--ease);
}

.cta:hover b {
  transform: rotate(90deg);
}

/* menu pill that expands into a panel */
.menu {
  width: 290px;
  overflow: hidden;
  background: var(--pill);
  color: var(--pillInk);
  backdrop-filter: blur(16px);
  border: 1px solid #ffffff12;
  border-radius: 18px;
  /* springy overshoot on the way open, like the iPhone dynamic island */
  transition:
    width 0.7s var(--spring),
    border-radius 0.7s var(--spring),
    background 0.7s;
}

.menu.open {
  width: min(470px, calc(100vw - 40px));
  border-radius: 22px;
}

.menu-top {
  display: flex;
  width: 100%;
  height: 48px;
  padding: 0 18px;
  justify-content: space-between;
  align-items: center;
}

.menu-top .lbl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.dots {
  display: grid;
  grid-template-columns: 4px 4px;
  gap: 3px;
  transition: transform 0.5s var(--ease);
}

.dots i {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
}

.menu.open .dots {
  transform: rotate(45deg);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: 0.7;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 10px #3ddc84;
}

.panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.7s var(--spring);
}

.menu.open .panel {
  grid-template-rows: 1fr;
}

.panel > div {
  overflow: hidden;
}

.panel nav {
  padding: 6px 10px 10px;
}

.panel nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px;
  border-radius: 12px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(8px);
  transition:
    opacity 0.4s,
    transform 0.5s var(--ease),
    filter 0.5s,
    background 0.2s;
}

.menu.open .panel nav a {
  opacity: 1;
  transform: none;
  filter: none;
}

.menu.open .panel nav a:nth-child(2) {
  transition-delay: 0.05s;
}
.menu.open .panel nav a:nth-child(3) {
  transition-delay: 0.1s;
}
.menu.open .panel nav a:nth-child(4) {
  transition-delay: 0.15s;
}

.panel nav a:hover {
  background: #ffffff12;
}

/* hovered item: slides right, an arrow slides in, the Japanese label brightens; the others dim back */
.panel nav a {
  position: relative;
}
.panel nav a::after {
  content: "↗";
  position: absolute;
  right: 10px;
  top: 50%;
  font-size: 18px;
  font-weight: 500;
  color: var(--star);
  opacity: 0;
  translate: -10px -50%;
  transition:
    opacity 0.3s,
    translate 0.45s var(--spring);
}
.menu.open .panel nav a:hover {
  transform: translateX(8px);
  background: linear-gradient(90deg, #ffffff1a, #ffffff06);
  transition-delay: 0s;
}
.menu.open .panel nav a:hover::after {
  opacity: 1;
  translate: 0 -50%;
}
.panel nav a:hover small {
  opacity: 0;
}
.menu.open .panel nav:has(a:hover) a:not(:hover) {
  opacity: 0.35;
  filter: blur(1px);
  transition-delay: 0s;
}

.panel nav a small {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.55;
}

.panel .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 20px 18px;
  border-top: 1px solid #ffffff14;
  font-size: 13px;
}

.panel .soc {
  display: flex;
  gap: 8px;
}

.panel .soc a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #ffffff14;
  opacity: 0.7;
  transition:
    opacity 0.25s,
    background 0.25s,
    border-color 0.25s,
    transform 0.35s var(--ease);
}

.panel .soc a:hover,
.panel .soc a:focus-visible {
  opacity: 1;
  background: #ffffff1a;
  border-color: #ffffff40;
  transform: translateY(-2px);
}

.panel .soc .ico,
.panel .soc svg {
  width: 16px;
  height: 16px;
}

.theme {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #ffffff14;
}

.theme button {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.6;
}

.theme button.on {
  background: var(--pillInk);
  color: var(--pill);
  opacity: 1;
}

/* night: the solid pills flip to white with black text */
[data-theme="night"] .cta,
[data-theme="night"] .view,
[data-theme="night"] .contact .mail {
  background: var(--ink);
  color: #000;
}

[data-theme="night"] .theme button.on {
  color: #000;
}

/* ── Hero ──────────────────────────────────── */
.hero {
  position: relative;
  height: 100svh;
  min-height: 780px;
  padding-top: 0;
  /* clip sideways only: the glow has to bleed down into the Work section, so not overflow:hidden */
  overflow-x: clip;
}

.haze {
  position: absolute;
  width: calc(70vw * var(--glow-size, 1)); /* --glow-size: set from the admin page (Appearance) */
  height: calc(70vw * var(--glow-size, 1));
  left: var(--gx);
  top: var(--gy);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--w0) 0%, var(--w1) 30%, var(--w2) 55%, transparent 72%);
  filter: blur(70px);
  opacity: var(--haze);
  pointer-events: none;
  transition: opacity 0.7s;
}

.meta {
  position: absolute;
  top: 120px;
  left: 40px;
  right: 40px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.meta .lbl {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
}

.meta .lbl b {
  color: var(--ink);
  font-weight: 600;
}

.head {
  font-size: min(6.6vw, 11vh);
}

.meta .r {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 22px;
  padding-bottom: 10px;
}

.meta .r p {
  max-width: 34ch;
  color: var(--dim);
  font-weight: 500;
}

/* giant wordmark lit by a glow that follows the mouse (js sets --tx/--ty) */
.word {
  position: absolute;
  left: 0;
  right: 0;
  /* the padding gives the gradient room to paint tall glyphs (シンバ): background-clip:text
     only paints inside the box, so a tight line-height used to chop their tops and bottoms.
     bottom is lowered by the same amount so the wordmark doesn't move */
  padding: 0.2em 0;
  bottom: calc(-2.2vw - 0.2em);
  z-index: 1;
  font-weight: 900;
  font-size: 26vw;
  line-height: 0.8;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: default;
  --wg: radial-gradient(
    calc(40vw * var(--glow-size, 1)) circle at var(--tx) var(--ty),
    var(--w0) 0%,
    var(--w1) 22%,
    var(--w2) 40%,
    var(--w3) 62%,
    var(--w4) 78%
  ); /* shared with .slogo and .sw b so they paint the same fixed gradient */
  background: var(--wg) fixed;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* the logo standing in for the S: a mask of logo.svg filled with the same fixed gradient as the letters */
.slogo {
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  margin-right: 0.02em;
  background: var(--wg) fixed;
  -webkit-mask: url(assets/logo.svg) center / 100% 100% no-repeat;
  mask: url(assets/logo.svg) center / 100% 100% no-repeat;
}

/* the S shrinks away while the logo grows in over it (markup built in home.js).
   No transform/scale/rotate here on purpose: a transformed element drags its fixed gradient with it and the
   colours go wrong mid-animation. So the S shrinks via font-size and the logo grows via mask-size instead */
.sw {
  position: relative;
  display: inline-block;
}
.sw b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: inherit;
  background: var(--wg) fixed;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: s-out 0.45s var(--ease) forwards;
}
.sw .slogo {
  animation: logo-in 0.9s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
@keyframes s-out {
  to {
    font-size: 0;
    opacity: 0;
    filter: blur(8px);
  }
}
@keyframes logo-in {
  from {
    -webkit-mask-size: 15% 15%;
    mask-size: 15% 15%;
    opacity: 0;
    filter: blur(10px);
  }
}

.arrow {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.arrow em {
  font-style: normal;
  margin-right: 16px;
}

.arrow span {
  display: block;
  /* 28px at the top, grows to 28 + 200px as home.js sets --ap (0..1) from the scroll position */
  width: calc(28px + var(--ap, 0) * 200px);
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: width 0.35s var(--ease);
}

.arrow svg {
  width: 18px;
  height: 18px;
  margin-left: -9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:hover span {
  width: calc(48px + var(--ap, 0) * 200px);
}

/* ── Reviews ───────────────────────────────── */
.rgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}
.rcard {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  transition:
    transform 0.4s var(--ease),
    border-color 0.3s,
    background 0.7s;
}
.rcard:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--star) 40%, var(--line));
}
.rstars {
  color: var(--star);
  font-size: 18px;
  letter-spacing: 3px;
}
.rcard blockquote {
  flex: 1;
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 500;
  line-height: 1.5;
}
.rcard figcaption {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.rcard figcaption b {
  font-weight: 800;
}
.rcard figcaption span {
  color: var(--dim);
}

.rwrite {
  margin-top: 28px;
  display: grid;
  justify-items: start;
  gap: 20px;
}
.rbtn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 700;
  transition:
    border-color 0.3s,
    background 0.3s;
}
.rbtn b {
  color: var(--star);
  transition: transform 0.4s var(--ease);
}
.rbtn:hover {
  border-color: var(--ink);
}
.rbtn:hover b {
  transform: rotate(90deg);
}
.rform {
  width: min(640px, 100%);
}
.rform .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .rform .two {
    grid-template-columns: 1fr;
  }
}
.rform[hidden] {
  display: none;
}
/* star picker: radios in reverse order so "this star and all before it" lights up with plain CSS */
.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}
.stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.stars label {
  color: var(--line);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.3s var(--spring);
}
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
  color: var(--star);
}
.stars label:hover {
  transform: scale(1.2);
}
.stars input:focus-visible + label {
  outline: 2px solid var(--star);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Sections ──────────────────────────────── */
section {
  position: relative;
  padding-top: 20vh;
}

.sh {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 56px;
}

.sh h2 {
  font-size: clamp(56px, 9vw, 150px);
}

.sh h2 small {
  display: inline-block;
  margin-left: 12px;
  font-family: "Noto Sans JP";
  font-size: 0.22em;
  letter-spacing: 0;
  vertical-align: top;
  color: var(--dim);
}

.sh p {
  max-width: 360px;
  color: var(--dim);
  font-weight: 500;
}

/* ── Work ──────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  position: relative;
  display: block;
}

.card.wide {
  grid-column: 1 / -1;
}

.media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  isolation: isolate;
  border-radius: 28px;
  background: var(--card);
  transition: background 0.7s;
}

.card.wide .media {
  aspect-ratio: 21 / 9;
}

/* blurred star "orbs": blur on the parent, star clip on the child (together they'd clip the blur) */
.orb {
  position: absolute;
  width: 62%;
  aspect-ratio: 1;
  filter: blur(38px);
  opacity: 0.85;
  transition: transform 1.2s var(--ease);
}

.orb i {
  position: absolute;
  inset: 0;
  background: var(--c);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.orb.a {
  left: -12%;
  bottom: -38%;
  --c: var(--c1);
}

.orb.b {
  right: -14%;
  top: -44%;
  --c: var(--c2);
  opacity: 0.65;
  transform: rotate(20deg);
}

.card:hover .orb.a {
  transform: translate(12%, -10%) rotate(-24deg) scale(1.1);
}

.card:hover .orb.b {
  transform: translate(-10%, 12%) rotate(50deg);
}

/* tilted glass screen */
.screen {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 62%;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5% 6%;
  border-radius: 14px;
  background: var(--scr);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -24px #0000004d;
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%) perspective(1400px) rotateX(8deg);
  transition:
    transform 1s var(--ease),
    background 0.7s;
}

.card:hover .screen {
  transform: translate(-50%, -52%) perspective(1400px) rotateX(0deg) scale(1.03);
}

.card.wide .screen {
  width: 44%;
}

.screen .bar {
  display: flex;
  gap: 5px;
}

.screen .bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.screen b {
  font-size: clamp(24px, 3.6vw, 60px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.9;
  text-transform: uppercase;
}

.screen b em {
  display: block;
  margin-top: 0.2em;
  font-family: "Noto Sans JP";
  font-style: normal;
  font-size: 0.42em;
  letter-spacing: 0;
  color: var(--soft);
}

.screen .lns {
  display: grid;
  gap: 6px;
}

.screen .lns i {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.screen .lns i:nth-child(2) {
  width: 70%;
}
.screen .lns i:nth-child(3) {
  width: 45%;
}

/* "View project" pill that follows the cursor inside a card */
.view {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pillInk);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.35s var(--ease);
}

.card:hover .view {
  transform: translate(-50%, -50%) scale(1);
}

.info {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 18px 6px 0;
}

.info h3 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.info h3 .jp {
  margin-left: 8px;
  font-weight: 500;
  text-transform: none;
}

.info p {
  margin-top: 6px;
  color: var(--dim);
  font-size: 14px;
  font-weight: 500;
}

/* stack tags (bottom-left) and year (top-right): hidden until you hover the card */
.corner {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s var(--ease),
    transform 0.5s var(--ease);
  pointer-events: none;
}

.corner.bl {
  left: 20px;
  bottom: 20px;
  max-width: 70%;
}
.corner.tr {
  right: 20px;
  top: 20px;
  transform: translateY(-8px);
}

.card:hover .corner,
.card:focus-visible .corner {
  opacity: 1;
  transform: none;
}

.corner span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--scr);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── About ─────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
  align-items: start;
  padding-top: 26vh;
}

.about h2 {
  position: sticky;
  top: 18vh;
  font-size: clamp(70px, 11vw, 190px);
}

.about .big {
  font-size: clamp(26px, 2.8vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

/* words light up as you scroll (js wraps each word in .w) */
.about .big .w {
  opacity: 0.16;
  transition: opacity 0.5s;
}

.about .big .w.on {
  opacity: 1;
}

.about .tr {
  display: grid;
  gap: 6px;
  margin-top: 28px;
  color: var(--dim);
  font-size: 15px;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

/* stack chips: dim by default, light up in the language's brand colour on hover */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.3s,
    color 0.3s,
    background 0.3s,
    transform 0.4s var(--ease),
    box-shadow 0.4s;
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--c);
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: 0 8px 30px -10px var(--c);
  transform: translateY(-2px);
}

/* the logo is a mask, so its colour is just a background colour */
.ico {
  display: block;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

/* detail card (one shared element, positioned by js/main.js) */
#tip {
  position: fixed;
  z-index: 95;
  width: 290px;
  padding: 18px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow:
    0 30px 70px -20px #0006,
    0 0 60px -24px var(--c);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.35s var(--ease);
}

#tip.below {
  transform: translateY(-8px) scale(0.97);
}

#tip.on {
  opacity: 1;
  transform: none;
}

.tip-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tip-head b {
  display: block;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tip-head small,
.tip-stats small {
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
}

.tip-ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
}

.tip-ico .ico {
  width: 24px;
  height: 24px;
}

#tip p {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

.tip-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 14px;
}

.tip-stats > div {
  padding: 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.tip-stats b {
  display: block;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.tip-stats em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
}

.tip-bar {
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
}

.tip-bar span {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: 3px;
  background: var(--c);
  transform-origin: left;
  animation: fill 0.7s 0.1s var(--ease) both;
}

@keyframes fill {
  from {
    transform: scaleX(0);
  }
}

@media (hover: none) and (pointer: coarse) {
  #tip {
    width: min(290px, calc(100vw - 24px));
  }
}

/* ── Contact ───────────────────────────────── */
.contact {
  margin-top: 26vh;
  padding-block: 18vh 40px; /* block only: the side padding comes from .px */
  overflow: hidden;
  border-top: 1px solid var(--line);
  text-align: center;
}

.contact .haze {
  width: 60vw;
  height: 60vw;
  left: 50%;
  top: 115%;
}

.contact .k {
  position: relative;
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.contact h2 {
  position: relative;
  margin: 22px 0 40px;
  font-size: min(15vw, 19vh);
}

.contact .mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 30px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pillInk);
  font-size: 17px;
  font-weight: 600;
  transition: transform 0.3s var(--ease);
}

.contact .mail:hover {
  transform: scale(1.05);
}

/* ── Footer ────────────────────────────────── */
.foot {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-top: 18vh;
  padding: 26px 0 6px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
}

.foot-l {
  justify-self: start;
  text-align: left;
}
.devwrap {
  justify-self: end;
}

.totop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition:
    color 0.3s,
    border-color 0.3s,
    transform 0.4s var(--ease);
}

.totop span {
  transition: transform 0.4s var(--ease);
}

.totop:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.totop:hover span {
  transform: translateY(-3px);
}

/* ── Signature pill + credit/version card ──── */
.devwrap {
  position: relative;
}

.dev {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--dim);
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.3s,
    color 0.3s,
    background 0.3s,
    box-shadow 0.4s;
}

.dev:hover,
.devwrap.open .dev {
  border-color: color-mix(in srgb, var(--w1) 55%, var(--line));
  color: var(--ink);
  background: color-mix(in srgb, var(--w1) 10%, transparent);
  box-shadow: 0 8px 30px -12px var(--w1);
}

.dev-av {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
}

.dev-av img,
.dav-in img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the signature name: italic serif, in the accent colour */
.dev em,
.dwho b {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--w1);
}

.dev em {
  font-size: 17px;
  margin-left: 2px;
}
.dev-chev {
  transition: transform 0.4s var(--ease);
}
.devwrap.open .dev-chev {
  transform: rotate(45deg);
}

.devcard {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  z-index: 60;
  width: min(360px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 22px;
  text-align: left;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--w1) 40%, var(--line));
  box-shadow:
    0 30px 70px -20px #0006,
    0 0 60px -28px var(--w1);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.97);
  transform-origin: bottom right;
  /* the small delay on the way out keeps it from flickering if the mouse wobbles */
  transition:
    opacity 0.25s 0.12s,
    transform 0.4s var(--ease) 0.12s,
    visibility 0s 0.45s;
}

/* invisible bridge over the gap between pill and card, so moving the mouse up doesn't close it */
.devcard::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 18px;
}

.devwrap.open .devcard {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* hover opens it too (mouse only; on touch screens a tap opens it, via .open) */
@media (hover: hover) {
  .devwrap:hover .devcard {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }

  .devwrap:hover .dev {
    border-color: color-mix(in srgb, var(--w1) 55%, var(--line));
    color: var(--ink);
    background: color-mix(in srgb, var(--w1) 10%, transparent);
    box-shadow: 0 8px 30px -12px var(--w1);
  }

  .devwrap:hover .dev-chev {
    transform: rotate(45deg);
  }
}

/* tabs: a little indicator slides between CREDIT and VERSION */
.dtabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--line);
}

.dtabs button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  transition: color 0.3s;
}

.dtabs button[aria-selected="true"] {
  color: var(--w1);
}

.dind {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 10px;
  background: color-mix(in srgb, var(--w1) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--w1) 35%, transparent);
  transition: transform 0.45s var(--ease);
}

.dtabs[data-tab="version"] .dind {
  transform: translateX(100%);
}

.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 8px #3ddc84;
}

.dpanel {
  padding: 4px 6px 4px;
  animation: dfade 0.45s var(--ease);
}
.dpanel[hidden] {
  display: none;
}
@keyframes dfade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.dwho {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.dwho small {
  display: block;
  color: var(--dim);
  font-family: var(--f);
  font-size: 13px;
  font-weight: 500;
}

.dwho b {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}
.dwho .role {
  font-size: 11px;
  margin-top: 2px;
}

/* avatar (the dashed ring around it was removed) */
.dav {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
}

.dav-in {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
}

.init {
  font-size: 1.1em;
  font-weight: 900;
} /* fallback letter if the avatar can't load */

.drows {
  display: grid;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.drows a,
.drows > div,
.dline,
.dlink {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px;
  border-radius: 10px;
}

.drows a {
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.3s var(--ease);
}

.drows a:hover {
  background: color-mix(in srgb, var(--w1) 10%, transparent);
  color: var(--w1);
  transform: translateX(3px);
}

.di {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--w1);
}
.drows.plain {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.drows.plain > div {
  color: var(--dim);
}

.dver {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 8px 6px;
}

.dv {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.dv .hash {
  color: var(--dim);
}

.env {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.dline {
  color: var(--dim);
  font-size: 13px;
}
.dline .di {
  color: var(--dim);
}

.dmsg {
  margin: 4px 8px 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.dlink {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  font-family: var(--f);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s;
}

.dlink:hover {
  color: var(--w1);
}

/* project card with a screenshot (set in the admin page) */
.screen.has-img {
  padding: 3.5%;
  gap: 3%;
}

.screen.has-img img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.empty {
  color: var(--dim);
  font-weight: 500;
}

/* ── Contact page ──────────────────────────── */
.cpage {
  position: relative;
  min-height: 100svh;
  padding-top: 150px;
  padding-bottom: 6vh;
}

.cpage .haze {
  left: 72%;
  top: 38%;
}

.cgrid {
  position: relative;
  display: grid;
  /* minmax(0, …) so the columns can't grow to fit the headline: the cycling word (talk / 話そう / scramble glyphs)
     changes width, and a plain 1fr would stretch to its nowrap width and shove the form around */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 6vw;
  align-items: start;
}

.cl .k {
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 26px;
}
.chead {
  font-size: clamp(72px, 10.5vw, 180px);
}

.lead {
  max-width: 34ch;
  margin-top: 34px;
  color: var(--dim);
  font-size: clamp(16px, 1.3vw, 20px);
  font-weight: 500;
  line-height: 1.5;
}

.cinfo {
  display: grid;
  gap: 4px;
  margin-top: 34px;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
}

.cinfo li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
}

.cinfo svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--w1);
}
.cinfo em {
  font-style: normal;
  color: var(--dim);
  font-size: 13px;
}
.cinfo a {
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s;
}
.cinfo a:hover {
  border-color: var(--w1);
}

.cinfo .live {
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 5px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 10px #3ddc84;
}

/* the form card */
.cform {
  position: relative;
  padding: clamp(22px, 3vw, 36px);
  border-radius: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: background 0.7s;
}

.fld {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.fld > label,
.fld > legend {
  display: flex;
  justify-content: space-between;
  padding: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* "(required)" sits right after the label text; the auto margin keeps the message counter pushed to the far right */
.req {
  margin: 0 auto 0 0.6em;
  color: var(--star);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.count {
  letter-spacing: 0;
  font-weight: 500;
  text-transform: none;
}

.fld input[type="text"],
.fld input[type="email"],
.fld textarea {
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  resize: vertical;
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    background 0.7s;
}

.fld textarea {
  min-height: 150px;
  line-height: 1.5;
}
.fld ::placeholder {
  color: var(--dim);
  opacity: 0.7;
}

.fld input:focus,
.fld textarea:focus {
  border-color: var(--w1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--w1) 16%, transparent);
}

.fld [aria-invalid="true"] {
  border-color: var(--w1);
}
.err {
  min-height: 0;
  color: var(--w1);
  font-size: 13px;
  font-weight: 600;
}
.err:empty {
  display: none;
}

/* topic chips: real radio buttons (keyboard friendly), styled as pills */
.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.topics legend {
  width: 100%;
  margin-bottom: 10px;
  float: left;
}
.topics label {
  position: relative;
  cursor: pointer;
}

.topics input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.topics span {
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  transition:
    color 0.25s,
    border-color 0.25s,
    background 0.25s,
    transform 0.3s var(--ease);
}

.topics label:hover span {
  color: var(--ink);
  border-color: var(--ink);
}

.topics input:checked + span {
  background: var(--pill);
  border-color: var(--pill);
  color: var(--pillInk);
}

.topics input:focus-visible + span {
  outline: 2px solid var(--w1);
  outline-offset: 3px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 58px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--pillInk);
  font-size: 17px;
  font-weight: 700;
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s;
}

.submit b {
  font-weight: 600;
  transition: transform 0.4s var(--ease);
}
.submit:hover b {
  transform: translate(3px, -3px);
}
.submit:hover {
  transform: scale(1.02);
}
.submit:disabled {
  opacity: 0.6;
  pointer-events: none;
}
[data-theme="night"] .submit {
  background: var(--ink);
  color: #000;
}

.fstatus {
  min-height: 1.4em;
  margin-top: 14px;
  color: var(--w1);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.fstatus a {
  text-decoration: underline;
}

/* sent state */
.sent {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 50px 10px;
  text-align: center;
}
.sent[hidden],
#cform[hidden] {
  display: none;
} /* display:grid above would otherwise beat the hidden attribute */
.sent.on .tick {
  animation: pop 0.8s var(--ease);
}

.tick {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--w1) 16%, transparent);
  color: var(--w1);
  font-size: 34px;
}

@keyframes pop {
  from {
    transform: scale(0) rotate(-120deg);
  }
}

.sent h2 {
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  line-height: 1;
}
.sent p {
  color: var(--dim);
  font-weight: 500;
}

.again {
  margin-top: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 600;
  transition:
    border-color 0.3s,
    color 0.3s;
}

.again:hover {
  border-color: var(--ink);
}
.cfoot {
  margin-top: 4vh;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 900px) {
  .meta {
    grid-template-columns: 1fr;
    top: 100px;
    left: 20px;
    right: 20px;
  }
  .head {
    font-size: 13vw;
  }
}

@media (max-width: 900px) {
  .cgrid {
    grid-template-columns: 1fr;
  }
  .cpage {
    padding-top: 120px;
  }
}

@media (max-width: 800px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .sh {
    flex-direction: column;
    align-items: flex-start;
  }
  .card.wide .media {
    aspect-ratio: 16 / 10;
  }
  .about {
    grid-template-columns: 1fr;
  }
  .about h2 {
    position: static;
  }
}

@media (max-width: 700px) {
  .px {
    --px-min: 20px;
    padding-inline: 20px;
  }
  .hdr {
    grid-template-columns: auto 1fr auto;
  }
  .menu {
    grid-column: 2;
    justify-self: end;
    width: auto;
    margin-right: 8px;
  }
  .tswitch {
    width: 44px;
    height: 44px;
  }
  .status,
  .cta,
  .arrow {
    display: none;
  }
}

@media (hover: none) {
  .view {
    display: none;
  }
  .corner {
    opacity: 1;
    transform: none;
  } /* touch screens can't hover, so always show them */
}

@media (pointer: coarse) {
  .cur {
    display: none;
  }
}

@media (max-width: 700px) {
  .foot {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .foot-l,
  .devwrap {
    justify-self: center;
  }
  .devcard {
    right: auto;
    left: 50%;
    translate: -50% 0;
    transform-origin: bottom center;
  }
}

/* 404 page: the home page hero, with a giant 404 as the wordmark */
.nf .word {
  font-size: min(42vw, 72svh);
}
.nf .arrow {
  --ap: 0.45;
  display: flex; /* the home page hides this arrow on phones; here it is the way back, so keep it */
  padding-block: 13px; /* finger-sized tap area */
  margin-block: -13px;
}

/* ── Phones & touch ────────────────────────── */
html {
  -webkit-text-size-adjust: 100%; /* iOS: don't resize text when the phone is rotated */
}
a,
button,
input,
select,
textarea,
label,
summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no 300ms tap delay, no double-tap zoom on controls */
}

@media (max-width: 700px) {
  /* The menu pill sits in a fixed spot beside the theme button and opens to the full width of the screen.
     (It used to grow inside the header grid and slid off the right edge.) */
  .menu {
    position: absolute;
    z-index: 2;
    top: max(24px, calc(env(safe-area-inset-top) + 10px)); /* same offset as .hdr's padding-top */
    right: 80px;
    width: 128px;
    margin: 0;
    transition:
      width 0.7s var(--spring),
      right 0.7s var(--spring),
      border-radius 0.7s var(--spring),
      background 0.7s;
  }
  .menu.open {
    right: 20px;
    width: calc(100vw - 40px);
  }
  .panel nav a {
    font-size: clamp(28px, 9vw, 34px);
  }
  .panel .row {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .theme {
    width: 100%;
  }
  .theme button {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
  }

  /* tighter vertical rhythm */
  section {
    padding-top: 12vh;
  }
  .contact {
    margin-top: 14vh;
    padding-block: 12vh 32px;
  }
  .sh {
    margin-bottom: 32px;
  }
  .haze {
    filter: blur(40px); /* a 70px blur on a screen-wide element is heavy for phone GPUs */
  }
}

/* notched phones (viewport-fit=cover in each page's <head>): keep the header and page edges clear of the notch / home bar */
.hdr {
  padding-top: max(24px, calc(env(safe-area-inset-top) + 10px));
}
.px {
  padding-left: max(var(--px-min, 20px), env(safe-area-inset-left));
  padding-right: max(var(--px-min, 20px), env(safe-area-inset-right));
}
.foot {
  padding-bottom: env(safe-area-inset-bottom);
}

/* finger-sized tap targets */
@media (pointer: coarse) {
  .panel .soc a {
    width: 44px;
    height: 44px;
  }
  .totop,
  .dev,
  .rbtn {
    min-height: 44px;
  }
  .stars label {
    font-size: 36px;
    padding: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .ln {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
