/* ============================================================
   hero.css – header + hero layout
   Loaded AFTER style.css; overrides only nav + hero.
   ============================================================ */

:root { --nav-h: 96px; }

/* never let the hero intro leave things stuck hidden on this page */
.js .hero__kicker,
.js .hero__sub,
.js .hero__scroll,
.js .hero__cta .btn { opacity: 1; }

/* ============================================================
   HEADER
   ============================================================ */
.dnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.dnav.is-scrolled { background: rgba(7,7,11,.88); }

.dnav__word { line-height: 1; flex: 0 0 auto; }
.dnav__word-a,
.dnav__word-b { display: block; font-family: var(--font-display); }
.dnav__word-a {
  font-weight: 500; font-size: 1.02rem;
  letter-spacing: .34em; text-indent: .34em;
  color: var(--text); opacity: .78;
}
.dnav__word-b {
  font-weight: 700; font-size: 1.62rem; letter-spacing: -.01em;
  margin-top: 2px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- right cluster --- */
.dnav__right { display: flex; align-items: center; gap: 14px; flex: 0 1 auto; min-width: 0; }
.dnav .lang-toggle { white-space: nowrap; flex: 0 0 auto; }
.dnav__cta {
  display: inline-flex; align-items: center;
  padding: 10px 22px; border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .86rem; font-weight: 500;
  transition: border-color .3s, color .3s, box-shadow .3s, background .3s;
}
.dnav__cta:hover {
  border-color: transparent; color: #0a0a12;
  background: var(--grad);
  box-shadow: 0 0 30px rgba(139,92,246,.4);
}
.dnav__burger { display: flex !important; }

/* --- overlay menu --- */
.dmenu__links a { display: flex; align-items: baseline; gap: clamp(12px, 2.4vw, 26px); }
.dmenu__links i {
  font-style: normal; color: var(--muted);
  font-size: clamp(.5rem, min(1.6vw, 1.1vh), .68rem);
  letter-spacing: .16em; transform: translateY(-.4em);
  transition: color .3s;
}
.dmenu__links a:hover i { color: var(--violet-bright); }

/* ============================================================
   HERO
   ============================================================ */
.dhero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 0;
}
.dhero__mesh {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(ellipse 72% 62% at 62% 46%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 62% 46%, #000 25%, transparent 78%);
}

/* text on the left, the portrait on the right */
.dhero__grid {
  position: relative; z-index: 2;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  grid-template-rows: 1fr auto auto auto auto 1fr;
  grid-template-areas:
    ".      photo"
    "kicker photo"
    "name   photo"
    "sub    photo"
    "cta    photo"
    ".      photo";
  align-content: stretch;
  column-gap: clamp(24px, 4vw, 72px);
  width: 100%; max-width: 1600px; margin: 0 auto;
  padding: calc(var(--nav-h) + 22px) var(--pad-x) 34px;
}

/* portrait with the status card tucked under it */
.dhero__right {
  grid-area: photo;
  position: relative;
  justify-self: center; align-self: center;
  width: max-content; max-width: 100%;
  min-width: 0;
}

.dhero__kicker {
  grid-area: kicker;
  margin: 0 0 22px; color: var(--muted); max-width: 42ch;
}

.dhero__name {
  grid-area: name;
  margin: 0 0 24px; padding: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.9rem, 7.2vw, 6.8rem);
  line-height: .88; letter-spacing: -.03em;
}
.dhero__name-a, .dhero__name-b {
  display: block;
  transition: transform .9s cubic-bezier(.65,0,.2,1);
}
.dhero__name-a {
  color: transparent;
  -webkit-text-stroke: 1.4px rgba(236,234,244,.42);
}
.dhero__name-b {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
html.is-boot .dhero__name-a { transform: translateX(-6px); }
html.is-boot .dhero__name-b { transform: translateX(6px); }

/* ---------- the portrait / droid ---------- */
.droid {
  position: relative; z-index: 3;
  margin: 5vh 0 0;
  height: min(74svh, 720px);
  aspect-ratio: 933 / 1400;
  outline: none;
}
.droid__wrap {
  position: relative; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, rgba(0,0,0,.55) 82%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 58%, rgba(0,0,0,.55) 82%, transparent 99%);
}
.droid__photo, .droid__chrome {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center top;
  user-select: none; -webkit-user-drag: none;
}
.droid__photo {
  filter: saturate(.92) contrast(1.04);
  transition: filter .8s;
}
html.is-boot .droid__photo { filter: saturate(.55) contrast(1.06) brightness(1.02); }

/* the android skin, wiped in top-down */
.droid__skin {
  position: absolute; inset: 0;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.05s cubic-bezier(.65,0,.2,1);
}
html.is-boot .droid__skin { clip-path: inset(0 0 0 0); }

.droid__chrome { filter: grayscale(1) contrast(1.16) brightness(1.3); }

.droid__tint, .droid__lines {
  position: absolute; inset: 0;
  -webkit-mask-image: url("../img/portrait-hero.png");
  mask-image: url("../img/portrait-hero.png");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center top; mask-position: center top;
}
.droid__tint {
  background: linear-gradient(158deg, #7c3aed 0%, #22d3ee 100%);
  mix-blend-mode: color; opacity: .72;
}
.droid__lines {
  background: repeating-linear-gradient(to bottom,
    rgba(103,232,249,.16) 0 1px, transparent 1px 6px);
  mix-blend-mode: screen; opacity: .24;
}

/* ---------- the wireframe rig ---------- */
.droid__rig { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rig path, .rig circle, .rig rect {
  fill: none;
  stroke: url(#rigGrad);
  stroke-width: 2.8;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset .85s cubic-bezier(.5,0,.2,1), opacity .3s;
}
html.is-boot .rig path,
html.is-boot .rig circle,
html.is-boot .rig rect { stroke-dashoffset: 0; opacity: .95; }

.rig--sketch path { stroke-width: 1.9; }
html.is-boot .rig--sketch path { opacity: .55; }
html.is-boot .rig--1 * { transition-delay: .14s; }
html.is-boot .rig--2 * { transition-delay: .28s; }
html.is-boot .rig--3 * { transition-delay: .40s; }
html.is-boot .rig--4 * { transition-delay: .50s; }
html.is-boot .rig--5 * { transition-delay: .58s; }
html.is-boot .rig--hud * { transition-delay: .68s; }
.rig--hud path { stroke-width: 2.4; opacity: 0; }
html.is-boot .rig--hud path { opacity: .55; }

.rig__eyes rect {
  fill: var(--cyan-bright); stroke: none;
  opacity: 0;
  filter: url(#rigGlow);
  transition: opacity .35s .55s;
}
html.is-boot .rig__eyes rect { opacity: 1; transition-delay: .55s; animation: eyePulse 2.4s ease-in-out .9s infinite; }
@keyframes eyePulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.rig__tag {
  fill: var(--cyan-bright); stroke: none;
  font-family: var(--font-mono); font-size: 26px; letter-spacing: 3px;
  opacity: 0; transition: opacity .4s;
}
html.is-boot .rig__tag { opacity: .8; transition-delay: .8s; }
.rig__tag--sm { font-size: 22px; }

/* ---------- boot scan line ---------- */
.droid__scan {
  position: absolute; left: -8%; right: -8%; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-bright) 22%, #fff 50%, var(--cyan-bright) 78%, transparent);
  box-shadow: 0 0 26px 7px rgba(34,211,238,.4);
  opacity: 0; pointer-events: none;
}
html.is-boot .droid__scan { animation: dscan 1.05s cubic-bezier(.65,0,.2,1) forwards; }
@keyframes dscan {
  0%   { top: 0;   opacity: 0; }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- hint ---------- */
.droid__hint {
  position: absolute; left: 50%; bottom: -6px;
  transform: translateX(-50%);
  color: var(--muted); white-space: nowrap;
  transition: opacity .3s;
  animation: hintPulse 2.6s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: .45; } 50% { opacity: .95; } }
html.is-boot .droid__hint, html.has-booted .droid__hint { opacity: 0; animation: none; }

/* ============================================================
   BOOT STATE – header reactions
   ============================================================ */

/* ============================================================
   FOOT + SIDE PANEL
   ============================================================ */
.dhero__sub {
  grid-area: sub;
  margin: 0 0 28px;
  font-size: clamp(1.14rem, 1.5vw, 1.52rem);
  line-height: 1.5;
  color: var(--text); opacity: .88;
  max-width: 26ch;
}
.dhero__cta { grid-area: cta; display: flex; gap: 12px; flex-wrap: wrap; }
.dhero__cta .btn { padding: 15px 30px; font-size: .95rem; }

.dpanel {
  /* sits on the faded-out bottom of the portrait, so it costs no layout height */
  position: absolute; left: 50%; bottom: 10px;
  transform: translateX(-50%);
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 20px; row-gap: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px 13px;
  background: rgba(12,12,21,.62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .64rem; letter-spacing: .1em;
  transition: border-color .5s, box-shadow .5s;
}
html.is-boot .dpanel {
  border-color: rgba(34,211,238,.35);
  box-shadow: 0 0 40px rgba(34,211,238,.12);
}
.dpanel__label { color: var(--muted); }
.dpanel__value { color: var(--text); justify-self: end; }
.dpanel__value::before { content: attr(data-h); }
html.is-boot .dpanel__value::before { content: attr(data-d); color: var(--cyan); }

.dpanel__bar {
  grid-column: 1 / -1;
  height: 3px; border-radius: 3px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.dpanel__bar i {
  display: block; height: 100%; width: 18%;
  background: var(--grad);
  transition: width 1.1s cubic-bezier(.65,0,.2,1);
}
html.is-boot .dpanel__bar i { width: 100%; }

.dpanel__rows {
  grid-column: 1 / -1;
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: space-between; gap: 14px;
}
.dpanel__rows li { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dpanel__rows b { font-weight: 400; color: var(--muted); }
.dpanel__rows span { color: var(--text); }
.dpanel__rows span::before { content: attr(data-h); }
html.is-boot .dpanel__rows span::before { content: attr(data-d); color: var(--cyan-bright); }

.dhero .hero__scroll {
  position: absolute; z-index: 6;
  left: 50%; transform: translateX(-50%);
  bottom: 22px; right: auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .dhero__name { font-size: clamp(2.7rem, 7.6vw, 5.4rem); }
}

@media (max-width: 1020px) {
  .dhero { min-height: auto; }
  .dhero__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "kicker" "name" "photo" "sub" "cta";
    align-content: start;
    padding-bottom: 56px;
  }
  .dhero__sub { max-width: none; }
  .dhero .hero__scroll { display: none; }
}

@media (max-width: 900px) {
  .dnav__cta { display: none; }
}

@media (max-width: 620px) {
  :root { --nav-h: 82px; }
  .dnav { gap: 10px; }
  .dnav__word-a { font-size: .78rem; letter-spacing: .28em; }
  .dnav__word-b { font-size: 1.22rem; }
  .dnav__right { gap: 10px; }
  .dnav .lang-toggle { padding: 6px 10px; font-size: .62rem; }

  .dhero__grid { padding-top: calc(var(--nav-h) + 22px); }
  .dhero__kicker { font-size: .68rem; margin-bottom: 16px; }
  .dhero__name { font-size: clamp(2.7rem, 13.5vw, 4.4rem); margin-bottom: 18px; }
  .dhero__cta { flex-direction: column; align-items: stretch; }
  .dhero__cta .btn { width: 100%; }
  .dpanel { font-size: .6rem; padding: 12px 14px 11px; bottom: 0; }
  .dpanel__rows { gap: 10px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .droid__hint { animation: none; }
  html.is-boot .droid__scan { animation: none; opacity: 0; }
  .droid__skin, .rig path, .rig circle, .rig rect { transition-duration: .01ms !important; }
}
