/* TexVastra website — base: tokens, type, layout, buttons, header, footer.
   Every colour is a docs/brand/guidelines.md §4 value (v1.2.1). Glass recipes are §6. */

@font-face { font-family: "Geist"; src: url("../assets/fonts/Geist-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../assets/fonts/GeistMono-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  /* Blues, one navy hue */
  --sky: #A0C0EE;      /* lit block on dark, focus on dark */
  --denim: #1E57C7;    /* lit block on light, links, focus on light */
  --indigo: #142E6A;   /* the brand: headings, primary buttons */
  --midnight: #091126; /* text, the night ground */
  /* Neutrals */
  --cotton: #F5F2EB; --white: #FFFFFF; --thread: #E3DED3; --slate: #535D70;
  /* Status (inside product mock-ups only, always with the word) */
  --moss: #2B7353; --amber: #8F5400; --madder: #B4234B;

  --font: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  --max: 1216px;
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1); /* ease-out; nothing bounces (§7) */
  --t: 200ms;
  --header-h: 64px;
  /* Warp-line field at the symbol's rhythm: thread t, gap t/2, three threads a block, 0.75 t between blocks */
  --t-px: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--midnight); background: var(--cotton);
  font-feature-settings: "ss01" 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 2.6vw + 1.9rem, 4.75rem); line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 1.6vw + 1.5rem, 3.25rem); line-height: 1.06; letter-spacing: -0.03em; color: var(--indigo); }
h3 { font-size: 1.25rem; line-height: 1.3; }
.lead { font-size: clamp(1.125rem, .35vw + 1.05rem, 1.3125rem); line-height: 1.55; text-wrap: pretty; }
.kicker { font-size: .9375rem; font-weight: 500; letter-spacing: 0; color: var(--slate); }
p { text-wrap: pretty; }

/* Layout */
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }
.band { padding-block: clamp(80px, 9vw, 136px); }
.on-dark { background: var(--midnight); color: var(--cotton); }
.on-dark h2 { color: var(--white); }
.on-dark .kicker { color: var(--cotton); }
.on-indigo { background: var(--indigo); color: var(--cotton); }
.on-indigo h2 { color: var(--white); }
.on-white { background: var(--white); }

/* Focus: Denim on light, Sky on dark (§4.1) */
:focus-visible { outline: 3px solid var(--denim); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible, .on-indigo :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--sky); }

/* Skip link */
.skip { position: fixed; left: 12px; top: -100px; z-index: 100; background: var(--white); color: var(--indigo); padding: 12px 18px;
  border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* Buttons: one pair. Solid White on dark grounds, solid Indigo on light grounds. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), border-color var(--t) var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--indigo); color: var(--white); }
.btn-primary:hover { background: var(--midnight); }
.btn-quiet { background: transparent; color: var(--indigo); border-color: color-mix(in srgb, var(--indigo) 35%, transparent); }
.btn-quiet:hover { border-color: var(--indigo); }
.on-dark .btn-primary, .site-header .btn-primary, .on-indigo .btn-primary { background: var(--white); color: var(--indigo); }
.on-dark .btn-primary:hover, .site-header .btn-primary:hover, .on-indigo .btn-primary:hover { background: var(--cotton); }
.on-dark .btn-quiet, .on-indigo .btn-quiet { color: var(--white); border-color: rgba(255, 255, 255, .32); }
.on-dark .btn-quiet:hover, .on-indigo .btn-quiet:hover { border-color: var(--white); }
.btn .arrow { transition: transform var(--t) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Header: Night frost glass (§6), solid where blur or transparency is unavailable */
.site-header { position: sticky; top: 0; z-index: 50; color: var(--white);
  background: rgba(9, 17, 38, .8); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 24px -16px rgba(9, 17, 38, .6); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; min-height: 44px; padding-block: 6px; text-decoration: none; }
.brand svg { height: 28px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none;
  font-size: .9375rem; font-weight: 500; color: var(--cotton); transition: background-color var(--t) var(--ease); }
.nav a:not(.btn):hover { background: rgba(255, 255, 255, .08); }
.nav .btn { min-height: 44px; margin-left: 12px; padding: 0 18px; font-size: .9375rem; }
.menu-toggle { display: none; }
.mobile-menu { display: none; }

@media (max-width: 860px) {
  .nav a:not(.btn) { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px;
    border-radius: 999px; border: 1px solid rgba(255, 255, 255, .32); background: transparent; color: var(--white); font-weight: 500; cursor: pointer; }
  .nav .btn { margin-left: 8px; padding: 0 16px; }
  .mobile-menu[data-open="true"] { display: block; background: var(--midnight); border-top: 1px solid rgba(255, 255, 255, .16); }
  .mobile-menu a { display: flex; align-items: center; min-height: 56px; padding: 0 var(--gutter); color: var(--white); text-decoration: none;
    font-size: 1.125rem; font-weight: 500; border-bottom: 1px solid rgba(255, 255, 255, .08); }
}
@media (max-width: 400px) { .brand svg { height: 24px; } .menu-toggle { padding: 0 12px; } .nav .btn { padding: 0 14px; } }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .site-header { background: var(--midnight); } }
@media (prefers-reduced-transparency: reduce) { .site-header { background: var(--midnight); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* Footer */
.site-footer { background: var(--midnight); color: var(--cotton); padding-block: 72px 40px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.footer-lockup img { height: 40px; width: auto; }
.footer-lockup .descriptor { margin-top: 40px; font-size: 1.125rem; color: var(--cotton); }
.footer-lockup .brand-line { margin-top: 6px; font-size: clamp(1.5rem, 1.2vw + 1.1rem, 2rem); font-weight: 600; letter-spacing: -0.02em; color: var(--white); }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--cotton); font-size: .9375rem;
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 10px) / 0 1px no-repeat; transition: background-size var(--t) var(--ease); }
.footer-links a:hover { background-size: 100% 1px; }
.footer-base { margin-top: 64px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .16); display: flex; flex-wrap: wrap; gap: 8px 32px;
  justify-content: space-between; font-size: .8125rem; color: var(--cotton); }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}

/* Logo motion (§7): the lit block is the only part that moves; it fades in last on load. */
.js .logo-inline .q1 { animation: lit 520ms var(--ease) 380ms both; }
@keyframes lit { from { opacity: 0; } to { opacity: 1; } }
/* Hero entrance, once on load */
.js .hero-copy > * { animation: rise 520ms var(--ease) both; }
.js .hero-copy > :nth-child(2) { animation-delay: 60ms; } .js .hero-copy > :nth-child(3) { animation-delay: 120ms; }
.js .hero-copy > :nth-child(4) { animation-delay: 180ms; } .js .hero-copy > :nth-child(5) { animation-delay: 240ms; }
.js .hero-visual { animation: rise 640ms var(--ease) 200ms both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .logo-inline .q1, .js .hero-copy > *, .js .hero-visual { animation: none; } }

/* ── Header themes and grounds ───────────────────────────── */
[hidden] { display: none !important; }
body { background: var(--midnight); }
main > section:not(.on-dark):not(.on-indigo):not(.on-white) { background: var(--cotton); }
.brand svg { height: 32px; }
.logo-on-light { display: none; }
/* Header over light sections: Day glass (§6), Midnight text, colour logo */
.site-header[data-theme="light"] { color: var(--midnight); background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 0 var(--thread); }
.site-header[data-theme="light"] .logo-on-dark { display: none; }
.site-header[data-theme="light"] .logo-on-light { display: block; }
.site-header[data-theme="light"] .nav a:not(.btn) { color: var(--midnight); }
.site-header[data-theme="light"] .nav a:not(.btn):hover { background: rgba(9, 17, 38, .06); }
.site-header[data-theme="light"] .btn-primary { background: var(--indigo); color: var(--white); }
.site-header[data-theme="light"] .btn-primary:hover { background: var(--midnight); }
.site-header[data-theme="light"] .menu-toggle { color: var(--midnight); border-color: color-mix(in srgb, var(--indigo) 35%, transparent); }
.site-header[data-theme="light"] :focus-visible { outline-color: var(--denim); }
.site-header { transition: background-color 200ms var(--ease), color 200ms var(--ease); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .site-header[data-theme="light"] { background: var(--white); } }
@media (prefers-reduced-transparency: reduce) { .site-header[data-theme="light"] { background: var(--white); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (max-width: 400px) { .brand svg { height: 26px; } }

main:focus { outline: none; }
.mobile-menu .menu-demo { display: none; }
@media (max-width: 359px) { .nav .btn { display: none; } .mobile-menu .menu-demo { display: flex; font-weight: 600; } }
