/**
 * Glasshead v3 — global components: header, menu, buttons, ruler, cursor,
 * footer, index rows, FAQ, form fields.
 */

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  --_bg: var(--btn-bg, var(--cobalt));
  --_fg: var(--btn-fg, var(--bone));
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 16px;
  height: 60px; padding: 0 28px;
  border: 1px solid var(--_bg); border-radius: 0;
  background: var(--_bg); color: var(--_fg);
  font-family: var(--font-body); font-size: 0.82rem; font-weight: 700; font-stretch: 100%;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  background: var(--btn-hover-bg, var(--bone));
  transform: translateY(102%);
  transition: transform 0.5s var(--ease);
}
.btn:hover, .btn:focus-visible { color: var(--btn-hover-fg, var(--ink)); border-color: var(--btn-hover-bg, var(--bone)); }
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn svg { transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(6px); }

.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn--ghost::before { background: var(--fg); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--bg); border-color: var(--fg); }
.btn--sm { height: 46px; padding: 0 20px; font-size: 0.75rem; }

/* text link with a growing rule */
.link {
  position: relative; display: inline-block; text-decoration: none; font-weight: 600;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size 0.5s var(--ease), color 0.3s;
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ─── Header ────────────────────────────────────────────────────── */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  height: var(--nav-h);
  background: var(--ink); color: var(--bone);
  border-bottom: 1px solid rgba(237, 234, 226, 0.16);
  transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.site-header.is-hidden { transform: translateY(-100%); opacity: 0; }
html.nav-hidden { --nav-offset: 0px; } /* set by main.js header() */
.site-header__inner {
  height: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark { width: 28px; height: auto; }
.brand__name {
  font-family: var(--font-display); font-weight: 900; font-stretch: 62.5%;
  font-size: 1.75rem; letter-spacing: 0.01em; text-transform: uppercase; line-height: 1;
}
.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 44px); }
.nav__list a {
  position: relative; text-decoration: none; font-size: 0.92rem; font-weight: 600;
  padding-block: 6px; color: rgba(237, 234, 226, 0.78); transition: color 0.3s;
}
.nav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--cobalt-light);
  transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease);
}
.nav__list a:hover, .nav__list .is-current > a, .nav__list .current-menu-item > a { color: var(--bone); }
.nav__list a:hover::after, .nav__list .is-current > a::after { transform: scaleX(1); }
.nav__cta { }

.nav-toggle {
  display: none; margin-left: auto; width: 48px; height: 48px; padding: 0;
  background: transparent; border: 1px solid rgba(237, 234, 226, 0.35); border-radius: 0; cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 6px;
}
.nav-toggle i { display: block; width: 22px; height: 2px; background: var(--bone); transition: transform 0.4s var(--ease); }
.nav-toggle[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 32px;
  background: var(--ink); color: var(--bone);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path 0.7s var(--ease-io), visibility 0s linear 0.7s;
}
.mobile-menu.is-open { clip-path: inset(0); visibility: visible; transition: clip-path 0.7s var(--ease-io), visibility 0s; }
.mobile-menu__list { display: flex; flex-direction: column; }
.mobile-menu__list a {
  display: block; text-decoration: none; padding-block: 6px;
  font-family: var(--font-display); font-weight: 900; font-stretch: 62.5%; text-transform: uppercase;
  font-size: clamp(3.4rem, 17vw, 6.5rem); line-height: 0.92; border-bottom: 1px solid rgba(237, 234, 226, 0.16);
}
.mobile-menu__list a:hover { color: var(--cobalt-light); }
.mobile-menu__close { display: none; }
.mobile-menu__contact { color: var(--muted); }
.mobile-menu__contact a { color: var(--bone); }
body.menu-open { overflow: hidden; }

@media (max-width: 960px) {
  .nav, .nav__cta { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (min-width: 961px) { .mobile-menu { display: none; } }

/* ─── Ruler (a measuring tape that scrolls past) + cursor ───────── */
.ruler {
  position: fixed; left: 0; top: 0; bottom: 0; width: 30px; z-index: var(--z-ruler);
  pointer-events: none; display: none; color: var(--ruler-fg, #EDEAE2); transition: color 0.4s;
}
.ruler__ticks {
  position: absolute; inset: 0; opacity: 0.55;
  background-image:
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 12px),
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 120px);
  background-size: 9px 100%, 20px 100%;
  background-repeat: no-repeat;
  background-position: 0 calc(var(--scroll, 0) * -1px), 0 calc(var(--scroll, 0) * -1px);
}
.ruler__label {
  position: absolute; left: 21px; top: calc(42% + 14px); white-space: nowrap;
  writing-mode: vertical-rl; letter-spacing: 0.04em;
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600;
}
.ruler__mark { position: fixed; left: 0; top: 42%; width: 30px; height: 3px; background: var(--ruler-mark, #7083FF); z-index: var(--z-ruler); pointer-events: none; display: none; }
@media (min-width: 1100px) and (hover: hover) { .ruler, .ruler__mark { display: block; } }

.cursor {
  position: fixed; left: 0; top: 0; z-index: var(--z-cursor); pointer-events: none;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 1px solid var(--cur-fg, #EDEAE2); border-radius: 50%; color: var(--cur-fg, #EDEAE2);
  display: grid; place-items: center; opacity: 0;
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  transition: opacity 0.4s, width 0.35s var(--ease), height 0.35s var(--ease), margin 0.35s var(--ease), background-color 0.35s, color 0.35s, border-color 0.35s;
}
.cursor::before, .cursor::after { content: ""; position: absolute; background: var(--cur-fg, #EDEAE2); }
.cursor::before { width: 9px; height: 1px; }
.cursor::after { width: 1px; height: 9px; }
.has-cursor .cursor { opacity: 1; }
.cursor.is-hot { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--cur-fg, #EDEAE2); color: var(--cur-bg, #0A0C1A); }
.cursor.is-link { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.cursor__text { position: relative; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .cursor { display: none; } }

/* ─── Footer ────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: var(--bone); padding-top: clamp(56px, 7vw, 110px); overflow: hidden; }
.site-footer__grid {
  display: grid; gap: 40px 48px; grid-template-columns: 1.15fr 1.7fr 1.2fr 1fr;
  padding-bottom: clamp(48px, 6vw, 96px);
}
.site-footer h3 { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-bottom: 18px; }
.site-footer ul { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { text-decoration: none; color: var(--bone); font-size: 0.98rem; font-weight: 500; }
.site-footer a:hover { color: var(--cobalt-light); }
.site-footer__cols { columns: 2; column-gap: 32px; display: block !important; }
.site-footer__cols li { break-inside: avoid; margin-bottom: 10px; }
.site-footer__contact { margin-top: 18px; }
.site-footer h3 a { color: var(--muted); }
.site-footer h3 a:hover { color: var(--bone); }
.site-footer__line { max-width: 28ch; color: var(--soft); margin-block: 18px 22px; }
.site-footer__base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px;
  padding-block: 20px; border-top: 1px solid rgba(237, 234, 226, 0.2);
  font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted);
}
.site-footer__word::before { content: "Glasshead"; }
.site-footer__word {
  display: block; width: 100%; line-height: 0.74; margin: clamp(8px, 2vw, 24px) 0 -0.06em;
  font-family: var(--font-display); font-weight: 900; font-stretch: 62.5%; text-transform: uppercase;
  font-size: min(21vw, 30rem); letter-spacing: -0.005em; color: var(--ink-3); text-align: center; user-select: none; white-space: nowrap;
}
@media (max-width: 1100px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__wide { grid-column: 1 / -1; order: 2; } }
@media (max-width: 520px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* ─── Index rows: services, related ────────────────────────────── */
.index { border-top: 1px solid var(--line-strong); }
.index__row {
  position: relative; display: block; isolation: isolate; overflow: hidden;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line-strong);
  color: var(--fg); text-decoration: none;
  transition: color 0.45s var(--ease);
}
.index__row::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--fill); transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform 0.55s var(--ease);
}
.index__main {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: center; gap: clamp(14px, 3vw, 48px);
  padding-block: clamp(18px, 2.2vw, 34px);
}
.index__name { font-size: clamp(2.3rem, 6.4vw, 7rem); }
.index__price { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; text-align: right; line-height: 1.5; }
.index__price b { display: block; font-weight: 700; font-size: 0.92rem; }
.index__arrow { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid currentColor; transition: transform 0.5s var(--ease), background-color 0.4s; }
.index__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--ease); }
.index__more > p { overflow: hidden; max-width: 62ch; font-size: 1.05rem; line-height: 1.45; }
.index__row:hover, .index__row:focus-visible { color: var(--on-fill); }
.index__row:hover::before, .index__row:focus-visible::before { transform: scaleY(1); }
.index__row:hover .index__more, .index__row:focus-visible .index__more { grid-template-rows: 1fr; }
.index__row:hover .index__more > p, .index__row:focus-visible .index__more > p { padding-bottom: clamp(20px, 2.4vw, 36px); }
.index__arrow svg { transition: transform 0.5s var(--ease); }
.index__row:hover .index__arrow { background: var(--on-fill); color: var(--fill); }
.index__row:hover .index__arrow svg { transform: rotate(-45deg); }
@media (hover: none) {
  .index__more { grid-template-rows: 1fr; }
  .index__more > p { padding-bottom: 22px; color: var(--soft); }
}
@media (max-width: 640px) {
  .index__main { grid-template-columns: minmax(0, 1fr) 44px; }
  .index__price { grid-column: 1; grid-row: 2; text-align: left; }
  .index__arrow { width: 44px; height: 44px; grid-row: 1; grid-column: 2; }
}

/* ─── FAQ ───────────────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--line-strong); }
.faq__item { border-bottom: 1px solid var(--line-strong); }
.faq__q {
  display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 24px; align-items: center;
  padding-block: clamp(20px, 2.4vw, 34px); cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 800; font-stretch: 72%; letter-spacing: -0.01em;
  font-size: clamp(1.5rem, 2.8vw, 2.7rem); line-height: 1.02;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q i { position: relative; width: 48px; height: 48px; border: 1px solid var(--line-strong); transition: background-color 0.35s, border-color 0.35s; }
.faq__q i::before, .faq__q i::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; transition: transform 0.45s var(--ease); }
.faq__q i::before { width: 18px; height: 2px; margin: -1px 0 0 -9px; }
.faq__q i::after { width: 2px; height: 18px; margin: -9px 0 0 -1px; }
.faq__item[open] .faq__q i { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.faq__item[open] .faq__q i::after { transform: scaleY(0); }
.faq__a { max-width: 70ch; padding: 0 72px clamp(24px, 3vw, 44px) 0; color: var(--soft); font-size: 1.12rem; line-height: 1.55; overflow: hidden; }

/* ─── Fields ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 0 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  color: var(--fg); font-size: 1.3rem; font-weight: 500; transition: border-color 0.3s, box-shadow 0.3s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 14px) 55%, calc(100% - 8px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; }
.field select option { color: #0A0C1A; }
.field textarea { resize: vertical; min-height: 140px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--signal); box-shadow: 0 1px 0 0 var(--signal); }

/* ─── Page transitions ──────────────────────────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.35s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in 0.6s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
