/* SwiftyCrow site — shared styles (Apple-developer-site homage). */

:root {
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --bg: #fff;
  --bg-gray: #f5f5f7;
  --cta-bg: #000;
  --card-bg: #fff;
  --card-border: rgba(0, 0, 0, 0.05);
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  --blue: #0066cc;
  --blue-btn: #0071e3;
  --blue-btn-hover: #0077ed;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(0, 0, 0, 0.08);
  --pill-bg: rgba(0, 0, 0, 0.05);
  --code-bg: #f5f5f7;
  --menu-bg: rgba(250, 250, 252, 0.94);
  --hairline: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.7);
  --radius: 18px;
  --content: 980px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --bg: #000;
    --bg-gray: #1d1d1f;
    --cta-bg: #1d1d1f;
    --card-bg: #1c1c1e;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: none;
    --blue: #2997ff;
    --nav-bg: rgba(0, 0, 0, 0.7);
    --nav-border: rgba(255, 255, 255, 0.12);
    --pill-bg: rgba(255, 255, 255, 0.08);
    --code-bg: #1c1c1e;
    --menu-bg: rgba(22, 22, 24, 0.96);
    --hairline: rgba(255, 255, 255, 0.16);
    --glass-bg: rgba(54, 54, 58, 0.55);
    --glass-border: rgba(255, 255, 255, 0.14);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.47059;
  letter-spacing: -0.022em;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: 48px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-border);
}
.nav-inner {
  max-width: var(--content); margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); }
.nav-brand img { width: 22px; height: 22px; border-radius: 5px; }
.nav-brand:hover { text-decoration: none; }
.nav-links { margin-left: auto; display: flex; gap: 24px; }
.nav-links a { color: var(--text); font-size: 12px; opacity: 0.85; letter-spacing: -0.01em; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a.active { opacity: 1; color: var(--blue); }

/* Hamburger menu — phones only. Keeps the wordmark and collapses the links
   into a dropdown so the bar never overflows. CSS-only (checkbox toggle). */
.nav-toggle { display: none; }
.nav-burger { display: none; }
.nav-scrim { display: none; }
@media (max-width: 640px) {
  .nav-inner { gap: 12px; padding: 0 16px; }
  .nav-burger {
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; margin-right: -8px; width: 34px; height: 34px; cursor: pointer;
  }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px;
    transition: transform .2s ease, top .2s ease, background .2s ease;
  }
  .nav-burger span { position: relative; }
  .nav-burger span::before, .nav-burger span::after { content: ""; position: absolute; left: 0; }
  .nav-burger span::before { top: -6px; }
  .nav-burger span::after { top: 6px; }
  .nav-toggle:checked ~ .nav-burger span { background: transparent; }
  .nav-toggle:checked ~ .nav-burger span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span::after { top: 0; transform: rotate(-45deg); }

  .nav-links {
    position: absolute; top: 48px; left: 0; right: 0; z-index: 2;
    display: none; flex-direction: column; gap: 0; margin: 0; padding: 6px 16px 12px;
    background: var(--menu-bg);
    backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { font-size: 16px; opacity: 1; padding: 12px 4px; border-top: 1px solid var(--hairline); }
  .nav-links a:first-child { border-top: 0; }

  /* Tap anywhere outside the menu to close it. */
  .nav-toggle:checked ~ .nav-scrim {
    display: block; position: fixed; inset: 48px 0 0; z-index: 1;
  }
}

/* Generic sections */
section { padding: 100px 22px; text-align: center; }
.section-gray { background: var(--bg-gray); }
.section-dark { background: var(--cta-bg); color: #f5f5f7; }
.wrap { max-width: var(--content); margin: 0 auto; }

.eyebrow { font-size: 21px; font-weight: 600; color: var(--blue); letter-spacing: 0; margin-bottom: 6px; }
h1 { font-size: clamp(48px, 8vw, 88px); font-weight: 600; line-height: 1.05; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 600; line-height: 1.07; letter-spacing: -0.015em; }
.sub { font-size: clamp(19px, 2.6vw, 28px); font-weight: 400; color: var(--text-secondary); margin-top: 14px; line-height: 1.25; }
.section-dark .sub { color: #a1a1a6; }

/* Buttons */
.cta { margin-top: 28px; display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn { display: inline-block; font-size: 17px; line-height: 1; font-weight: 400; padding: 12px 22px; border-radius: 980px; transition: background .2s, opacity .2s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-btn); color: #fff; }
.btn-primary:hover { background: var(--blue-btn-hover); }
.btn-link { color: var(--blue); padding: 12px 6px; }
.btn-link:hover { text-decoration: underline; }
.section-dark .btn-link { color: #2997ff; }

/* Code pill */
.brew {
  margin: 22px auto 0; max-width: 520px;
  display: flex; align-items: center; gap: 12px;
  background: var(--pill-bg); border-radius: 12px; padding: 12px 16px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px;
  color: var(--text); letter-spacing: 0;
}
.section-dark .brew { background: rgba(255,255,255,0.08); color: #f5f5f7; }
.brew code { flex: 1; text-align: left; overflow-x: auto; white-space: nowrap; }
.brew button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 13px; font-family: inherit; padding: 2px 4px; }
.section-dark .brew button { color: #2997ff; }

/* Footer */
footer { background: var(--bg-gray); color: var(--text-secondary); font-size: 12px; padding: 34px 22px; }
.footer-inner { max-width: var(--content); margin: 0 auto; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--hairline); }
.footer-links a { color: var(--text-secondary); }
footer p { line-height: 1.5; }
.footer-apps { margin-top: 10px; }
.footer-apps .cur { color: var(--text); font-weight: 600; }

/* ---------- Landing page ---------- */
.hero { padding-top: 70px; padding-bottom: 40px; }
.hero-icon { width: 124px; height: 124px; margin: 0 auto 22px; border-radius: 27px; box-shadow: 0 14px 40px rgba(0,0,0,0.18); }
.hero .meta { font-size: 15px; color: var(--text-secondary); margin-top: 16px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 60px; text-align: left; }
.feature { background: var(--card-bg); border-radius: var(--radius); padding: 32px 28px; border: 1px solid var(--card-border); box-shadow: var(--card-shadow); }
.feature .ico { font-size: 30px; margin-bottom: 14px; }
.feature h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.feature p { font-size: 16px; color: var(--text-secondary); margin-top: 8px; line-height: 1.4; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

/* Animated showcase: a looping product demo that walks through tiling,
   directional focus, swap, zoom, workspace switching, and floating windows.
   A small JS state machine in index.html drives the stages; CSS transitions
   animate every move. */
.showcase { padding: 30px 22px 96px; text-align: center; }
.scene {
  max-width: 880px; margin: 0 auto; padding: 40px 40px 30px;
  border-radius: 34px; border: 1px solid var(--card-border); overflow: hidden;
  position: relative;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(41, 151, 255, 0.22), transparent 55%),
    radial-gradient(90% 80% at 100% 110%, rgba(52, 199, 89, 0.16), transparent 60%),
    var(--bg-gray);
}
.screen {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  border-radius: 16px; overflow: hidden;
}
.menubar {
  position: absolute; top: 0; left: 0; right: 0; height: 8%; z-index: 5;
  display: flex; align-items: center; justify-content: flex-start; padding: 0 10px;
}
.wsrail { display: flex; gap: 5px; align-items: center; }
.wspill {
  font-size: 10.5px; font-weight: 600; color: var(--text-secondary);
  padding: 3px 9px; border-radius: 6px; border: 1px solid transparent;
  background: var(--glass-bg); opacity: 0.7;
  transition: color .3s ease, background .3s ease, opacity .3s ease;
}
.wspill.active { color: #fff; background: var(--blue-btn); opacity: 1; }
.win {
  position: absolute; border-radius: 11px; padding: 9px; overflow: hidden;
  display: flex; flex-direction: column; gap: 7px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(170%); -webkit-backdrop-filter: blur(14px) saturate(170%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  outline: 2px solid transparent; outline-offset: 2px;
  opacity: 0; transform: scale(0.96); pointer-events: none;
  transition: top .5s cubic-bezier(.4,0,.2,1), left .5s cubic-bezier(.4,0,.2,1),
    width .5s cubic-bezier(.4,0,.2,1), height .5s cubic-bezier(.4,0,.2,1),
    opacity .35s ease, transform .45s cubic-bezier(.4,0,.2,1),
    outline-color .3s ease, box-shadow .3s ease;
}
.win.show { opacity: 1; transform: scale(1); }
.win.focused { outline-color: var(--blue); box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 0 0 3px rgba(41,151,255,0.28); z-index: 3; }
.win .wtitle { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--text); }
.win .dots { display: flex; gap: 4px; }
.win .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--text); opacity: 0.16; }
.win .wbody { flex: 1; border-radius: 7px; background: linear-gradient(160deg, rgba(127,127,127,0.18), rgba(127,127,127,0.05)); }
.hud {
  position: absolute; left: 50%; top: 50%; z-index: 6;
  padding: 12px 20px; border-radius: 15px; font-size: 15px; font-weight: 600; color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  opacity: 0; transform: translate(-50%, -50%) scale(0.9); transition: opacity .3s, transform .3s;
}
.hud.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.caption-wrap { margin-top: 24px; min-height: 56px; }
.scene-caption { font-size: 20px; font-weight: 500; color: var(--text); letter-spacing: -0.01em; transition: opacity .25s ease; }
@media (max-width: 620px) {
  .scene { padding: 24px 18px 22px; border-radius: 26px; }
  .scene-caption { font-size: 17px; }
  .win .wtitle { font-size: 10px; }
}

/* ---------- Doc pages (DocC-inspired) ---------- */
.doc { max-width: 1100px; margin: 0 auto; display: flex; gap: 0; align-items: flex-start; }
.doc-side {
  position: sticky; top: 48px; flex: 0 0 260px; align-self: flex-start;
  max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 32px 16px 32px 22px; border-right: 1px solid var(--hairline);
}
.doc-side .side-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); margin-bottom: 12px; }
.doc-side a { display: block; color: var(--text-secondary); font-size: 14px; padding: 5px 10px; border-radius: 7px; letter-spacing: -0.01em; }
.doc-side a:hover { color: var(--text); background: var(--pill-bg); text-decoration: none; }
.doc-side a.active { color: var(--blue); background: var(--pill-bg); font-weight: 500; }
.doc-side a.lvl-3 { padding-left: 22px; font-size: 13px; }

.doc-main { flex: 1; min-width: 0; padding: 40px 40px 120px; }
.doc-eyebrow { font-size: 15px; font-weight: 600; color: var(--blue); letter-spacing: 0; }

/* Rendered markdown (DocC-like typography) */
.md { max-width: 720px; }
.md h1 { font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 6px 0 24px; }
.md h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; margin: 48px 0 14px; padding-top: 8px; scroll-margin-top: 64px; }
.md h3 { font-size: 20px; font-weight: 600; margin: 30px 0 10px; scroll-margin-top: 64px; }
.md p { font-size: 17px; line-height: 1.6; margin: 14px 0; color: var(--text); }
.md ul, .md ol { margin: 14px 0 14px 22px; }
.md li { font-size: 17px; line-height: 1.6; margin: 6px 0; }
.md a { color: var(--blue); }
.md strong { font-weight: 600; }
.md code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em;
  background: var(--pill-bg); padding: 0.15em 0.4em; border-radius: 5px; letter-spacing: 0;
}
.md pre {
  background: var(--code-bg); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 18px 0;
}
.md pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.5; }
.md table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.md th, .md td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.md th { font-weight: 600; border-bottom: 2px solid var(--hairline); }
.md td code { white-space: nowrap; }
.md blockquote {
  margin: 18px 0; padding: 12px 18px; border-left: 3px solid var(--blue);
  background: var(--pill-bg); border-radius: 0 10px 10px 0; color: var(--text-secondary);
}
.md hr { border: 0; border-top: 1px solid var(--hairline); margin: 36px 0; }

@media (max-width: 820px) {
  .doc { display: block; }
  .doc-side { display: none; }
  .doc-main { padding: 28px 22px 80px; }
}

/* ---------- Releases page ---------- */
.releases-head { max-width: 760px; margin: 0 auto; padding: 56px 22px 8px; text-align: center; }
.releases-head h1 { font-size: clamp(40px, 6vw, 64px); }
.release-list { max-width: 760px; margin: 0 auto; padding: 24px 22px 120px; }
.release {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--card-shadow); padding: 28px 30px; margin: 22px 0;
}
.release-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.release-top h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.release-tag { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--blue); background: var(--pill-bg); padding: 3px 9px; border-radius: 980px; }
.release-date { margin-left: auto; font-size: 13px; color: var(--text-secondary); }
.release .md { max-width: none; }
.release .md h1 { font-size: 22px; margin: 20px 0 10px; }
.release .md h2 { font-size: 19px; margin: 22px 0 8px; border: 0; }
.release .md p, .release .md li { font-size: 15.5px; }

.state { max-width: 760px; margin: 0 auto; padding: 40px 22px; text-align: center; color: var(--text-secondary); font-size: 16px; }
