/* ---------- Homepage hero: the night street (hero.js) ---------- */
/* Always night, like a photograph: it keeps its own dark colours in both themes. */

.hero-night {
  --hn-night: #07080d; --hn-ink: #f3e9dc; --hn-soft: rgba(243, 233, 220, 0.78); --hn-mute: rgba(243, 233, 220, 0.55);
  --hn-line: rgba(243, 233, 220, 0.18); --hn-crema: #e0a96d; --hn-crema-2: #f1c58f;
  position: relative; height: 100vh; height: 100svh; min-height: 560px; padding: 0; overflow: hidden; isolation: isolate;
  background: var(--hn-night); color: var(--hn-ink);
}
/* styles.css makes homepage sections transparent; the hero stays night while the street loads */
main > section.hero-night { background: var(--hn-night); }
#night { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; transform: translate3d(0, calc(var(--p, 0) * 28%), 0) scale(calc(1 + var(--p, 0) * 0.06)); transform-origin: 60% 70%; will-change: transform; }
/* scrolling fades the hero itself out from the bottom, so the next section's sky shows straight through: no seam */
.hero-night .melt { display: none; }
main > section.hero-night {
  -webkit-mask-image: linear-gradient(0deg, transparent 0%, transparent calc(var(--p, 0) * 40%), #000 calc(var(--p, 0) * 95%));
          mask-image: linear-gradient(0deg, transparent 0%, transparent calc(var(--p, 0) * 40%), #000 calc(var(--p, 0) * 95%));
}
.hero-night .shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, #07080d 0%, rgba(7, 8, 13, 0.7) 10%, rgba(7, 8, 13, 0.25) 24%, rgba(7, 8, 13, 0) 38%),
    linear-gradient(0deg, #07080d 0%, rgba(7, 8, 13, 0.85) 9%, rgba(7, 8, 13, 0.35) 24%, rgba(7, 8, 13, 0) 42%),
    linear-gradient(90deg, #07080d 0%, rgba(7, 8, 13, 0.97) 18%, rgba(7, 8, 13, 0.88) 28%, rgba(7, 8, 13, 0.62) 37%, rgba(7, 8, 13, 0.3) 46%, rgba(7, 8, 13, 0.1) 54%, rgba(7, 8, 13, 0) 62%);
}
.hero-night .night-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font: 400 0.8rem var(--mono); color: var(--hn-mute); z-index: -1; }
.hero-night .night-loading[hidden] { display: none; }

.hero-copy { opacity: calc(1 - var(--p, 0) * 1.8); translate: 0 calc(var(--p, 0) * -110px); }
.hero-copy { position: absolute; left: clamp(16px, 6vw, 96px); right: clamp(16px, 6vw, 96px); bottom: clamp(56px, 13vh, 132px); max-width: 680px; z-index: 1; }
.hero-copy .eyebrow { margin: 0 0 18px; color: var(--hn-crema); }
.hero-copy h1 { margin: 0; font: 400 clamp(2.8rem, 6.4vw, 5.8rem)/1.02 var(--serif); letter-spacing: -0.035em; color: var(--hn-ink); text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35); }
.hero-copy h1 em { font-style: italic; font-weight: 340; color: var(--hn-crema); }
.hero-sub { margin: 20px 0 0; max-width: 60ch; font-size: 1.05rem; color: var(--hn-soft); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 30px; }
/* Order a project: a dark glass pill; crema pours out of the dot and fills it on hover */
.hero-btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 14px; height: 54px; padding: 0 26px 0 6px; border-radius: 999px;
  background: rgba(224, 169, 109, 0.07); border: 1px solid rgba(224, 169, 109, 0.5); color: var(--hn-ink);
  font: 500 0.95rem var(--sans); letter-spacing: 0.01em;
  box-shadow: 0 0 0 0 rgba(224, 169, 109, 0), 0 14px 40px -18px rgba(224, 169, 109, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.hero-btn::before {
  content: ""; position: absolute; z-index: -1; left: 6px; top: 50%; width: 42px; height: 42px; border-radius: 50%;
  background: var(--hn-crema); translate: 0 -50%; transition: scale 0.55s cubic-bezier(0.7, 0, 0.2, 1);
}
.hb-dot { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #0b0b12; flex: none; }
.hb-dot svg { width: 18px; height: 18px; transition: translate 0.35s ease; }
.hero-btn:hover { color: #0b0b12; border-color: var(--hn-crema); box-shadow: 0 0 0 4px rgba(224, 169, 109, 0.12), 0 18px 46px -16px rgba(224, 169, 109, 0.75); }
.hero-btn:hover::before { scale: 9; }
.hero-btn:hover .hb-dot svg { translate: 3px 0; }

/* See the menu: quiet text, an outlined arrow, a crema line drawn in on hover */
.hero-more { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font: 400 0.95rem var(--sans); color: var(--hn-soft); transition: color 0.3s ease; }
.hero-more::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: var(--hn-crema); transform: scaleX(0); transform-origin: left; transition: transform 0.45s cubic-bezier(0.7, 0, 0.2, 1); }
.hero-more:hover { color: var(--hn-ink); }
.hero-more:hover::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .hero-btn::before, .hb-dot svg, .hero-more::after { transition: none; } }
.hero-btn:focus-visible, .hero-more:focus-visible { outline: 2px solid var(--hn-crema); outline-offset: 3px; }
.hero-scroll { opacity: calc(1 - var(--p, 0) * 4); }
.hero-scroll { position: absolute; right: clamp(16px, 4vw, 56px); bottom: 28px; margin: 0; font: 400 0.7rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--hn-mute); z-index: 1; }

/* the copy slides in from the left while the street blows in */
.hero-copy > * { transition: opacity 1s ease, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.hero-night.brewing .hero-copy > * { opacity: 0; transform: translateX(-36px); }
.hero-copy > :nth-child(2) { transition-delay: 0.15s; }
.hero-copy > :nth-child(3) { transition-delay: 0.3s; }
.hero-copy > :nth-child(4) { transition-delay: 0.45s; }

@media (max-width: 860px) {
  /* phones: the shop sits in the top half; the copy reads on the dark below it */
  .hero-copy { bottom: clamp(28px, 6vh, 56px); }
  .hero-copy h1 { font-size: clamp(2.5rem, 11vw, 3.6rem); }
  .hero-sub { font-size: 1rem; }
  .hero-night .shade { background: linear-gradient(180deg, rgba(7, 8, 13, 0.75) 0%, rgba(7, 8, 13, 0) 14%), linear-gradient(0deg, #07080d 0%, #07080d 30%, rgba(7, 8, 13, 0.85) 40%, rgba(7, 8, 13, 0) 56%); }
  .hero-scroll { display: none; }
}

/* the headline is written with a pen (hero.js): a thin outline is traced left to right, and the real text is
   wiped in right behind the pen. The headline itself is never swapped for a copy, so nothing blinks at the end. */
.hero-copy h1 { position: relative; }
.hero-copy h1 .pw { display: inline-block; clip-path: inset(-25% 100% -25% -5%); }
.hero-copy h1 .pw.go { animation: pw-ink var(--idur, 0.6s) cubic-bezier(0.4, 0, 0.2, 1) var(--id, 0s) forwards; }
@keyframes pw-ink { to { clip-path: inset(-25% -12% -25% -5%); } }
.hero-copy h1 .pen { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.hero-copy h1 .pen text {
  fill: none; stroke-width: 1.1px; stroke-linejoin: round; stroke-dasharray: 2400; stroke-dashoffset: 2400;
  clip-path: inset(0 100% 0 0);
}
.hero-copy h1 .pen.go text {
  animation: pen-trace var(--dur, 1s) linear var(--d, 0s) forwards, pen-lift 0.5s ease calc(var(--d, 0s) + var(--dur, 1s) * 0.7) forwards;
}
@keyframes pen-trace { to { stroke-dashoffset: 0; clip-path: inset(0 -10% 0 0); } }
@keyframes pen-lift { to { stroke-opacity: 0; } }

/* "A software studio" is an ink chop: stamped on once everything else has landed (hero.js adds .chopped) */
.hero-copy .eyebrow {
  display: inline-block; padding: 7px 12px 6px; border: 1.5px solid currentColor; border-radius: 3px;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='44'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  -3 0 0 0 2.55'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>") 0 0 / 180px 44px;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='44'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  -3 0 0 0 2.55'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>") 0 0 / 180px 44px;
}
.hero-night.chop-wait .hero-copy > .eyebrow { opacity: 0; transition: none; }
.hero-night.chopped .hero-copy > .eyebrow { animation: chop 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes chop {
  0% { opacity: 0; transform: scale(2.4); filter: blur(3px); }
  50% { opacity: 1; transform: scale(0.9); filter: blur(0); }
  72% { transform: scale(1.04); }
  100% { opacity: 1; transform: none; }
}

/* Chinese headline (软件，深夜手冲。) stays on one line, sized to fit narrow screens */
:root[lang^="zh"] .hero-copy h1 { white-space: nowrap; text-wrap: nowrap; font-size: min(clamp(2.6rem, 6vw, 5.4rem), 10.5vw); }
