/* SorayaOS public site. Consumes docs/soraya/tokens.css roles only. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font: 18px/1.6 var(--font-sans);
  display: flex; min-height: 100vh; flex-direction: column;
}
main { flex: 1; }
main:focus { outline: none; }
.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 16px; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.5vw, 36px); }
h3 { font-size: 22px; }
p, ul, ol, table, pre, dl { margin: 0 0 16px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
a:active { color: var(--link-active); }
a:visited { color: var(--link-visited); }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--bg-subtle); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code-bg); color: var(--code-text); padding: 20px 24px; border-radius: 8px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; padding: 0; font-size: 15px; }
pre .comment { color: var(--code-muted); }
.muted { color: var(--text-muted); }
.eyebrow { display: block; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.lede { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.45; max-width: 36ch; }
.intro { max-width: 68ch; color: var(--text-muted); }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 48px; }
.prose h3 { margin-top: 32px; }

/* Skip link and focus */
.skip { position: absolute; left: 16px; top: -200px; padding: 12px 16px; background: var(--primary); color: var(--on-primary); border-radius: 6px; z-index: 10; }
.skip:focus { top: 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg-page); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; flex-wrap: wrap; }
.lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-height: 44px; }
.lockup:hover, .lockup:visited { color: var(--text); }
.lockup .mark { width: 30px; height: 30px; flex: none; }
.wordmark { font-size: 24px; font-weight: 650; letter-spacing: 0; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.site-nav a:hover { background: var(--bg-hover); color: var(--text); }
.site-nav a:visited { color: var(--text); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--primary); color: var(--selected-text); font-weight: 600; }
.site-nav a.external::after { content: " ↗"; color: var(--text-muted); }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-text); padding: clamp(56px, 9vw, 120px) 0 clamp(64px, 10vw, 136px); isolation: isolate; }
.hero .eyebrow { color: var(--hero-accent); }
.hero h1 { max-width: 12ch; }
.hero .lede { color: var(--hero-text); }
.hero .context { color: var(--hero-muted); max-width: 60ch; }
.hero a { color: var(--hero-accent); }
.hero a:hover { color: var(--hero-text); }
.hero-art { position: absolute; inset: auto -2% 0 auto; width: min(760px, 78vw); height: auto; color: var(--hero-accent); z-index: -1; pointer-events: none; }
.hero .wrap { pointer-events: none; }
.hero .wrap * { pointer-events: auto; }
.hero-art .gold { fill: var(--hero-gold); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 1px solid var(--border-control); color: var(--text); background: var(--bg-surface); }
.button:hover { background: var(--bg-hover); color: var(--text); }
.button:visited { color: var(--text); }
.button.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.button.primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.hero .button { background: transparent; color: var(--hero-text); border-color: var(--hero-muted); }
.hero .button:hover { background: rgb(255 255 255 / 8%); color: var(--hero-text); }
.hero .button.primary { background: var(--hero-accent); color: var(--hero-bg); border-color: var(--hero-accent); }
.hero .button.primary:hover { background: var(--hero-text); border-color: var(--hero-text); color: var(--hero-bg); }
.hero :focus-visible { outline-color: var(--hero-text); }
.hero .button.primary:focus-visible { outline-color: var(--hero-text); }

/* Rising: the canonical mark entrance, applied to the hero cluster */
.rise circle { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); animation: soraya-rise 420ms cubic-bezier(.22, 1, .36, 1) forwards; }
.rise circle:nth-child(2) { animation-delay: 90ms; } .rise circle:nth-child(3) { animation-delay: 180ms; } .rise circle:nth-child(4) { animation-delay: 270ms; }
.rise circle:nth-child(5) { animation-delay: 360ms; } .rise circle:nth-child(6) { animation-delay: 450ms; } .rise circle:nth-child(7) { animation-delay: 540ms; }
@keyframes soraya-rise { to { opacity: 1; transform: scale(1); } }
/* A second copy plays Rising while the pointer is on the hero mark.
   Hiding that copy on the way out keeps the animation from running again. */
.mark-hover { pointer-events: auto; }
.replay { opacity: 0; }
.replay circle { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.6); }
.mark-hover:hover .rise { opacity: 0; }
.mark-hover:hover .replay { opacity: 1; }
.mark-hover:hover .replay circle { animation: soraya-rise 420ms cubic-bezier(.22, 1, .36, 1) forwards; }
.mark-hover:hover .replay circle:nth-child(2) { animation-delay: 90ms; }
.mark-hover:hover .replay circle:nth-child(3) { animation-delay: 180ms; }
.mark-hover:hover .replay circle:nth-child(4) { animation-delay: 270ms; }
.mark-hover:hover .replay circle:nth-child(5) { animation-delay: 360ms; }
.mark-hover:hover .replay circle:nth-child(6) { animation-delay: 450ms; }
.mark-hover:hover .replay circle:nth-child(7) { animation-delay: 540ms; }
@media (prefers-reduced-motion: reduce) {
  /* The token file stops other motion in 0.01ms. This cross-fade is the one
     reduced-motion entrance the brand guide keeps, so it has to win. */
  .rise circle { transform: none; animation: soraya-fade 200ms linear forwards !important; animation-delay: 0ms !important; }
  .mark-hover:hover .replay circle { transform: none; animation: soraya-fade 200ms linear forwards !important; animation-delay: 0ms !important; }
  @keyframes soraya-fade { to { opacity: 1; } }
}
.motion-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 24px; }

/* Sections */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section > .wrap > h2 { max-width: 24ch; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-top: 32px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.card h3 { margin: 0; }
.card p { margin: 0; }
.card p + p { margin-top: 8px; }
.card .meta { color: var(--text-muted); font-size: 16px; }
.card .more { margin-top: auto; padding-top: 12px; }
.card.quiet { background: transparent; }

/* Status labels: the word is the cue, color is secondary */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--neutral-border); background: var(--neutral-bg); color: var(--neutral-text); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.available { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.status.experimental { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }
.status.experimental::before { border-radius: 0; transform: rotate(45deg); }
.status.planned::before { background: transparent; border: 2px solid currentColor; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border: 1px solid var(--info-border); border-left-width: 4px; border-radius: 6px; background: var(--info-bg); color: var(--info-text); margin: 24px 0; }
.notice a { color: inherit; }
.notice.warning { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning-text); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 16px; }
caption { text-align: left; color: var(--text-muted); padding-bottom: 12px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); }
th { font-weight: 650; }
thead th { background: var(--bg-subtle); padding-left: 12px; }
td:first-child, th:first-child { padding-left: 12px; }
td:last-child, th:last-child { padding-right: 12px; }

/* Flow diagram */
.flow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-top: 32px; counter-reset: step; list-style: none; padding: 0; }
.flow li { position: relative; padding: 20px 20px 20px 56px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; }
.flow li::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 18px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-weight: 650; font-size: 15px; }
.flow strong { display: block; margin-bottom: 4px; }
.flow span { color: var(--text-muted); font-size: 16px; }

/* Brand page swatches */
.swatches { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 24px; }
.swatch { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-surface); }
.swatch .chip { height: 72px; }
.swatch .label { padding: 10px 12px; font-size: 15px; }
.swatch .label code { display: block; background: none; padding: 0; color: var(--text-muted); font-size: 13px; }
/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 0 0 48px; color: var(--text-muted); font-size: 16px; }
.site-footer .horizon { display: block; width: 100%; height: 60px; color: var(--primary); opacity: .6; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr; align-items: start; }
.footer-lockup { color: var(--text); margin-bottom: 8px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { display: inline-block; padding: 6px 0; }
@media (max-width: 720px) {
  .wrap { width: min(1120px, 100% - 32px); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-bottom: 280px; }
  .hero-art { width: 112vw; inset: auto -24% -8% auto; opacity: .85; }
}

/* Forced colors keep borders and the current page visible */
@media (forced-colors: active) {
  .button, .status, .card, .flow li, .notice { border-color: ButtonText; }
  .site-nav a[aria-current="page"] { border-bottom-color: Highlight; }
  .hero :focus-visible, .hero .button.primary:focus-visible { outline-color: Highlight; }
  .hero-art { color: CanvasText; }
}
@media print {
  /* The hero uses fixed night colors. Printing follows the light theme, and the hero is ink on paper. */
  [data-soraya] { color-scheme: light; }
  .site-nav, .hero-art, .skip { display: none; }
  .hero, .hero .lede, .hero .context, .hero .eyebrow, .hero a, .hero .button, .hero .button.primary { color: #000; background: none; border-color: #000; }
}
