/* MYARA — home: 3D hero + method strip. */

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--paper);
}

.hero__stage {
  position: absolute;
  inset: 0;
}

.hero__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 0;
  transition: opacity 2.4s var(--ease);
}

.hero.is-live .hero__stage canvas { opacity: 1; }
.hero.is-looking .hero__stage canvas { cursor: grabbing; }

/* overlays never block the look drag except links */
.hero__meta,
.hero__hint,
.hero__pen { pointer-events: none; }

.hero__zoom { display: inline-flex; gap: 6px; margin-left: 6px; pointer-events: auto; }

.hero__zoom button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--hair-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 12px/1 var(--font-mono);
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.hero__zoom button:hover { background: var(--ink); color: var(--paper); }

/* the statement lives in the 3D; the h1 stays for assistive tech */
.hero__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* slow staggered reveal */
.hero__meta,
.hero__hint,
.hero__down {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1.8s var(--ease), transform 1.8s var(--ease);
}

body.is-ready .hero__meta,
body.is-ready .hero__hint,
body.is-ready .hero__down { opacity: 1; transform: none; }

body.is-ready .hero__meta { transition-delay: 1.4s; }
body.is-ready .hero__hint { transition-delay: 2.2s; }
body.is-ready .hero__down { transition-delay: 2.5s; }

/* ---- tiny live readout ---- */

.hero__meta {
  position: absolute;
  z-index: 2;
  top: calc(var(--nav-h) + 22px);
  right: var(--gutter);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.12em;
  text-align: right;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero__meta [data-hero="seg"],
.hero__meta [data-hero="path"] { color: var(--ink); }

/* ---- tracing pen ---- */

.hero__pen {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  opacity: 0;
  will-change: transform, opacity;
}

.hero__pen-cross {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
}

.hero__pen-cross::before,
.hero__pen-cross::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.hero__pen-cross::before { left: 0; right: 0; top: 50%; height: 1px; }
.hero__pen-cross::after { top: 0; bottom: 0; left: 50%; width: 1px; }

.hero__pen.is-flip .hero__pen-label { left: auto; right: 12px; }

.hero__pen-label {
  position: absolute;
  left: 12px;
  top: 6px;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* ---- hint + down link ---- */

/* bottom-right corner, just above the Method link */
.hero__hint {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--graphite);
}

.hero__hint-line {
  width: 36px;
  height: 1px;
  background: var(--hair-strong);
  transform-origin: left center;
  animation: hint-line 4.8s var(--ease) infinite;
}

@keyframes hint-line {
  0%, 100% { transform: scaleX(0.25); }
  50% { transform: scaleX(1); }
}

.hero__down {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  bottom: 24px; /* bottom-right corner, level with the metrics' last line */
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.hero__down-rule {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
  transition: width 0.8s var(--ease);
}

.hero__down:hover .hero__down-rule { width: 56px; }

/* WebGL unavailable: quiet paper; reduced motion: a still drawing, no pen, nothing to drag */
.hero.is-static .hero__hint,
.hero.is-static .hero__pen,
.hero.is-still .hero__pen { display: none; }

/* ---------------- method ---------------- */

.method {
  position: relative;
  z-index: 2;
  background: var(--paper);
  padding: clamp(88px, 14vh, 160px) var(--gutter) clamp(104px, 16vh, 180px);
  border-top: 1px solid var(--line);
}

.method__head { max-width: 1200px; margin: 0 auto; }

.method__title {
  margin: 20px 0 0;
  max-width: 22ch;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.method__lede {
  margin: 22px 0 0;
  max-width: 60ch;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.method__list {
  list-style: none;
  margin: clamp(48px, 8vh, 80px) auto 0;
  padding: 0;
  max-width: 1200px;
  border-bottom: 1px solid var(--line);
}

.method__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 0.9fr) minmax(0, 1.3fr) auto;
  align-items: baseline;
  gap: clamp(16px, 2.4vw, 40px);
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.method__item:first-child { border-top-color: var(--hair-strong); }

.method__no {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
}

.method__name {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
}

.method__item p {
  margin: 0;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.method__status {
  font-size: 9px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.method__research {
  max-width: 1200px;
  margin: 28px auto 0;
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-dim);
}

.method__research .label {
  flex: none;
  font-size: 9px;
  letter-spacing: 0.16em;
  padding: 3px 7px;
  border: 1px solid var(--hair-strong);
  color: var(--ink);
}

.method__research-text { max-width: 70ch; }

.method__research-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  border-bottom: 1px solid var(--hair-strong);
  transition: border-color 0.4s var(--ease);
}

.method__research-link:hover { border-bottom-color: var(--ink); }

.method__links {
  max-width: 1200px;
  margin: clamp(64px, 10vh, 112px) auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
}

.method__link {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--hair-strong);
  border-bottom: 1px solid var(--line);
}

.method__link .mono { font-size: 11px; letter-spacing: 0.2em; }

.method__arrow {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: transform 0.8s var(--ease);
}

.method__link:hover .method__arrow { transform: translateX(6px); }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .method__item { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 6px; }
  .method__item p { grid-column: 2 / 3; grid-row: 2; }
}

@media (max-width: 640px) {
  .hero__meta { font-size: 8px; top: calc(var(--nav-h) + 10px); left: var(--gutter); white-space: normal; }
  body[data-page="home"] .mx-readout--br { display: none; }
  .hero__down { display: none; }
  .hero__hint { right: var(--gutter); bottom: auto; top: calc(var(--nav-h) + 104px); }
  .method__links { grid-template-columns: 1fr; gap: 0; }
  .method__item { grid-template-columns: 32px minmax(0, 1fr); }
  .method__item p { grid-column: 2; grid-row: auto; }
  .method__status { grid-column: 2; }
  .method__research { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__hint-line { animation: none; transform: none; }
}

/* keep the bottom-left corner clear on home */
body[data-page="home"] .mx-readout--bl,
body[data-page="home"] .mx-readout--br { display: none; } /* keep the bottom quiet beside the metrics */

.hero__pen--quiet .hero__pen-label { display: none; }
.hero__pen--quiet .hero__pen-cross { transform: scale(0.7); opacity: 0.7; }

/* ---- touch screens: no drag / zoom controls; a small two-finger hint until the first touch ---- */

.hero__touch { display: none; }

@media (hover: none) and (pointer: coarse) {
  .hero__hint { display: none; }

  .hero__touch {
    display: block;
    position: absolute;
    z-index: 2;
    right: var(--gutter);
    bottom: calc(clamp(84px, 12vh, 132px) + 40px);
    margin: 0;
    padding: 7px 12px;
    font-size: 9px;
    letter-spacing: 0.14em;
    white-space: nowrap;
    color: var(--graphite);
    background: rgba(246, 246, 244, 0.86);
    border: 1px solid var(--hair);
    pointer-events: none;
    transition: opacity 0.6s var(--ease);
  }

  .hero.is-touched .hero__touch { opacity: 0; }
}

@media (hover: none) and (pointer: coarse) and (max-width: 640px) {
  .hero__touch { bottom: auto; top: calc(var(--nav-h) + 104px); font-size: 8.5px; letter-spacing: 0.1em; }
}
