/* awni.in: shared foundation for every page. Tokens and components are documented in design/DESIGN.md. */
@import url('../fonts/fonts.css');

:root {
  /* colour: the dark room, one signal */
  --bg: #04050c;
  --surface: #0b0d1a;
  --surface-2: #121427;
  --line: rgba(236, 232, 223, .1);
  --ink: #ece8df;
  --muted: #a8a39a;
  --faint: #5d5a54;
  --accent: #ff2e88;
  --accent-hi: #ff5ca3;

  /* Hα poster tones (pre-mapped from the gradient map) */
  --p0: #12001f; --p1: #290338; --p2: #4c085e; --pd: #3a0649;
  --pl: #ffa186; --pt: #ffd1b8; --ps: #ff406a; --pm: #ff5a3c;

  /* type */
  --display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --text: 'Switzer', 'Helvetica Neue', Arial, sans-serif;
  --data: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --t-mega: clamp(64px, 12.2vw, 228px);
  --t-h1: clamp(48px, 7.2vw, 116px);
  --t-h2: clamp(38px, 4.6vw, 72px);
  --t-h3: clamp(26px, 2.5vw, 40px);
  --t-lead: clamp(20px, 1.75vw, 27px);
  --t-body: 17px;
  --t-small: 15px;
  --t-label: 12px;

  /* space and motion */
  --m: clamp(16px, 2.2vw, 32px);
  --gap-section: clamp(120px, 16vw, 220px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { font: 400 var(--t-body)/1.6 var(--text); background: var(--bg); overflow-x: clip; font-feature-settings: 'ss01', 'kern'; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--p0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main, footer { position: relative; z-index: 1; }
/* decorative glows bleed past the edges; clip them here, since body overflow alone does not stop mobile zoom-out */
main, .breathe { overflow-x: clip; }

/* ---------- type roles ---------- */
.eyebrow { display: flex; align-items: baseline; gap: 14px; font: 500 var(--t-label)/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.eyebrow b { color: var(--accent); font-weight: 500; }
.eyebrow::after { content: ''; flex: 0 0 48px; height: 1px; background: var(--line); align-self: center; }
.display em, .h2 em, h1 em, h2 em { font-style: italic; font-weight: 300; }
.lead { font: 300 var(--t-lead)/1.4 var(--display); letter-spacing: -.01em; }
.mono { font-family: var(--data); font-size: 13px; letter-spacing: .02em; }
.ln-mask { padding-bottom: .14em; margin-bottom: -.14em; }
.line-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line-mask > span { display: block; }

/* ---------- the bar ---------- */
.bar { position: fixed; inset: 0 0 auto; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--m) var(--m) 0; font-size: var(--t-small); pointer-events: none; }
.bar::before { content: ''; position: absolute; inset: 0 0 -28px; z-index: -1; background: linear-gradient(rgba(4, 5, 12, .92), rgba(4, 5, 12, 0)); pointer-events: none; }
.bar a, .bar button { pointer-events: auto; text-decoration: none; }
.mark { justify-self: start; font: 400 italic 24px/1 var(--display); letter-spacing: -.02em; display: inline-flex; align-items: baseline; }
.mark b { display: inline-block; width: .2em; height: .2em; margin: 0 .07em; border-radius: 50%; background: var(--accent); transform: translateY(-.02em); }
.exp { font: 400 12px/1 var(--data); letter-spacing: .06em; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav { justify-self: end; display: flex; gap: clamp(16px, 2vw, 32px); align-items: center; }
.nav a, .nav button { background: none; border: 0; cursor: pointer; padding: 0; font: 500 13px/1 var(--data); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.nav [aria-current='page'] { color: var(--accent); }
.nav { position: relative; }
.nav > a, .nav > button { transition: color .5s var(--ease); }
.nav .on { color: var(--pt); }
.nav-dot { position: absolute; left: -2px; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); opacity: 0; pointer-events: none; }
.where { position: absolute; left: var(--m); top: calc(var(--m) + 34px); width: 40vw; height: 14px; overflow: hidden; font: 500 10px/14px var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; pointer-events: none; }
.where > span { display: block; position: absolute; left: 0; top: 0; }
.where b { color: var(--accent); font-weight: 500; }

/* text that rolls up to a copy of itself on hover */
.roll { display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.25; height: 1.25em; }
.roll > span { display: block; transition: transform .55s var(--ease); }
.roll > span::after { content: attr(data-t); display: block; color: transparent;
  /* the copy that rolls in is lit from inside by a nebula */
  background: linear-gradient(90deg, rgba(255, 46, 136, .35), rgba(255, 46, 136, .35)), url('../img/orion-s.jpg') 50% 50% / 220% auto; -webkit-background-clip: text; background-clip: text; filter: brightness(1.35) saturate(1.3); }
.roll:hover > span, .roll:focus-visible > span { transform: translateY(-50%); }
.nav .roll, .foot .roll, .roll > span { line-height: 1.25; }

/* underline that draws in from the left */
.ul { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .5s var(--ease); }
.ul:hover, .ul:focus-visible { background-size: 100% 1px; }

/* text lit from inside: on hover an ink layer wipes away and the words show a nebula (set --lit to change the image) */
.lit-text { color: transparent; -webkit-background-clip: text; background-clip: text; background-repeat: no-repeat;
  /* ink (wipes away) · a warm veil so dark parts of the photo still read · the photo */
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(rgba(255, 214, 196, .34), rgba(255, 214, 196, .34)), var(--lit, url('../img/orion-s.jpg'));
  background-size: 100% 100%, 100% 100%, cover; background-position: 100% 0, 0 0, 50% 50%;
  transition: background-size .9s var(--ease-io), filter .9s var(--ease-io); }
a:hover .lit-text, a:focus-visible .lit-text, .row:hover .lit-text, .card:hover .lit-text { background-size: 0% 100%, 100% 100%, cover; filter: brightness(1.45) saturate(1.35); }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 12px; background: var(--accent); color: var(--p0); font: 500 13px/1 var(--data); letter-spacing: .12em; text-transform: uppercase;
  padding: 18px 24px; text-decoration: none; border: 0; cursor: pointer; overflow: hidden; isolation: isolate; transition: transform .14s var(--ease); will-change: transform; }
.btn { transition: transform .14s var(--ease), color .45s var(--ease); }
/* hover: a nebula wipes in from the side the cursor entered, and leaves the way it went (common.js sets data-dir) */
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(4, 5, 12, .18), rgba(4, 5, 12, .38)), url('../img/cliffs-s.jpg') 50% 45% / cover;
  clip-path: inset(100% 0 0 0); transition: clip-path .62s var(--ease-io); }
.btn[data-dir='t']::before { clip-path: inset(0 0 100% 0); } .btn[data-dir='l']::before { clip-path: inset(0 100% 0 0); } .btn[data-dir='r']::before { clip-path: inset(0 0 0 100%); }
.btn.lit::before, .btn:focus-visible::before { clip-path: inset(0); }
.btn.snap::before { transition: none; }
.btn.lit, .btn:focus-visible { color: var(--ink); text-shadow: 0 1px 12px rgba(4, 5, 12, .6); }
.btn:active { scale: .97; }
.btn .arr { display: inline-block; transition: transform .5s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn.ghost { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost.lit { box-shadow: inset 0 0 0 1px transparent; }

/* ---------- forms: contact and newsletter ---------- */
.field { display: grid; gap: 8px; }
.field label { font: 500 11px/1 var(--data); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0 12px; font: 300 22px/1.35 var(--display); color: var(--ink); border-radius: 0; transition: border-color .3s; resize: vertical; }
.field textarea { min-height: 120px; font-size: 20px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-note { font: 400 12px/1.5 var(--data); color: var(--muted); letter-spacing: .04em; min-height: 1.5em; }
.form-note.ok { color: var(--ink); } .form-note.err { color: var(--accent); }

/* contact: a panel that slides in from the right */
.contact { position: fixed; inset: 0 0 0 auto; margin: 0 0 0 auto; width: min(560px, 100%); height: 100%; max-height: none; max-width: none; border: 0; padding: 0; background: var(--surface); color: var(--ink); z-index: 120;
  transform: translateX(100%); transition: transform .7s var(--ease-io), overlay .7s allow-discrete, display .7s allow-discrete; }
.contact[open] { transform: none; }
@starting-style { .contact[open] { transform: translateX(100%); } }
.contact::backdrop { background: rgba(4, 5, 12, .6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .6s, overlay .7s allow-discrete, display .7s allow-discrete; }
.contact[open]::backdrop { opacity: 1; }
@starting-style { .contact[open]::backdrop { opacity: 0; } }
.contact .in { height: 100%; overflow-y: auto; padding: calc(var(--m) * 2.2) calc(var(--m) * 1.6); display: flex; flex-direction: column; gap: 28px; }
.contact h2 { font: 300 clamp(40px, 5vw, 64px)/.95 var(--display); letter-spacing: -.03em; }
.contact p { color: var(--muted); }
.contact form { display: grid; gap: 26px; }
.contact .x { position: absolute; top: var(--m); right: var(--m); background: none; border: 0; cursor: pointer; font: 500 12px/1 var(--data); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.contact .alt { margin-top: auto; display: grid; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); font-size: var(--t-small); }
.contact .alt a { display: flex; justify-content: space-between; text-decoration: none; }
.contact .alt a span { color: var(--muted); }
html.contact-open { overflow: hidden; }

/* newsletter: one line, one field */
.subscribe { display: grid; gap: 18px; max-width: 560px; }
.subscribe .row2 { display: flex; gap: 12px; align-items: end; }
.subscribe .field { flex: 1; }

/* ---------- fixed layers ---------- */
.redlight { position: fixed; inset: 0; z-index: 190; background: #ff1d0d; mix-blend-mode: multiply; pointer-events: none; opacity: 0; transition: opacity .6s var(--ease); }
html[data-mode='red'] .redlight { opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 195; transform: translate(-50%, 20px); opacity: 0; background: var(--surface-2); color: var(--ink); padding: 12px 18px; font: 400 13px/1.4 var(--data); letter-spacing: .04em; transition: .4s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.cursor { position: fixed; left: 0; top: 0; z-index: 199; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(236, 232, 223, .7); transition: scale .25s var(--ease), box-shadow .25s; opacity: 0; }
.cursor::before, .cursor::after { content: ''; position: absolute; left: 50%; top: 50%; background: var(--accent); opacity: 0; transition: opacity .2s; }
.cursor::before { width: 1px; height: 100%; transform: translate(-50%, -50%); }
.cursor::after { height: 1px; width: 100%; transform: translate(-50%, -50%); }
.cursor.on { opacity: 1; }
.cursor.hot { scale: 1.8; box-shadow: inset 0 0 0 .6px var(--accent); }
.cursor.hot::before, .cursor.hot::after { opacity: .9; }


/* ---------- ambient night ---------- */
.fx-back { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx-front { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 198; pointer-events: none; }
.vignette { position: fixed; inset: 0; z-index: 180; pointer-events: none; background: radial-gradient(130% 100% at 50% 45%, transparent 55%, rgba(2, 2, 8, .55) 100%); }
.grain { position: fixed; inset: -50%; z-index: 181; pointer-events: none; opacity: .055; mix-blend-mode: overlay; background-size: 160px 160px; animation: grain 1.2s steps(6) infinite; }
.grain.still { animation: none; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); } }

/* a nebula glow that breathes behind section openings */
.breathe { position: relative; }
.breathe::before { content: ''; position: absolute; z-index: -1; left: -14vw; top: -6vw; width: min(70vw, 900px); aspect-ratio: 1.5; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 46, 136, .11), rgba(91, 10, 110, .09) 45%, transparent 75%); animation: breathe 12s ease-in-out infinite; }
.breathe.r::before { left: auto; right: -14vw; animation-delay: -6s; }
@keyframes breathe { 0%, 100% { opacity: .5; transform: translate3d(0, 0, 0) scale(1); } 50% { opacity: 1; transform: translate3d(3vw, 1.5vw, 0) scale(1.14); } }

/* floating image preview that trails the cursor over list rows */
.float-prev { position: fixed; left: 0; top: 0; z-index: 1; width: 320px; aspect-ratio: 3 / 2; margin: -107px 0 0 -160px; pointer-events: none; overflow: hidden; opacity: 0; scale: .7;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(236, 232, 223, .08); }
.float-prev img { width: 100%; height: 100%; object-fit: cover; scale: 1.15; filter: brightness(.65) saturate(.9) contrast(1.05); }
@media (pointer: fine) { html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; } }

/* ---------- footer ---------- */
.foot { margin-top: 20svh; padding: 48px var(--m) 30px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px 32px; font-size: var(--t-small); color: var(--muted); border-top: 1px solid var(--line); }
.foot h2 { font: 300 clamp(28px, 3vw, 44px)/1.05 var(--display); letter-spacing: -.02em; color: var(--ink); margin-bottom: 8px; }
.foot nav { display: flex; gap: 12px 24px; flex-wrap: wrap; align-content: start; justify-content: end; }
.foot nav a, .foot button { text-decoration: none; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 0; font: 500 12px/1.25 var(--data); letter-spacing: .14em; text-transform: uppercase; }
.foot .legal { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; font: 400 12px/1.4 var(--data); letter-spacing: .06em; color: var(--faint); }

/* ---------- page transitions between documents ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .45s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in .7s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; filter: blur(6px); transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(24px); } }

@media (max-width: 760px) {
  .bar::before { inset: 0 0 -36px; background: linear-gradient(rgba(4, 5, 12, .97) 55%, rgba(4, 5, 12, 0)); }
  .bar { grid-template-columns: auto 1fr; gap: 16px; }
  .bar > span:empty { display: none; }
  .nav { gap: 16px; } .nav a, .nav button { font-size: 11px; letter-spacing: .1em; }
  .mark { font-size: 21px; }
  .foot { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; } .foot nav { justify-content: start; }
  .foot .legal { flex-direction: column; }
  .subscribe .row2 { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
