/* ============================================================================
   Argonaut — getargonaut.io
   Hand-crafted, dependency-free stylesheet.
   ========================================================================== */

/* ----- Design tokens ------------------------------------------------------ */
:root {
  /* Brand (from the official logo) */
  --brand:        #f26722;   /* argonaut orange   */
  --brand-bright: #ff8a3d;   /* highlight         */
  --brand-deep:   #ee2a24;   /* nautilus red      */
  --brand-glow:   rgba(242, 103, 34, 0.55);
  --term:         #3ddc84;   /* terminal green    */
  --ceph:         #e6007a;   /* ceph accent (sparingly) */

  /* Surfaces */
  --bg:           #fbfaf8;
  --bg-2:         #f4f2ee;
  --surface:      #ffffff;
  --surface-2:    #f6f4f0;
  --card:         #ffffff;
  --border:       rgba(15, 20, 30, 0.10);
  --border-2:     rgba(15, 20, 30, 0.16);

  --text:         #17202e;
  --text-2:       #44506a;
  --text-3:       #6b7688;

  --ok:           #16a34a;
  --warn:         #d97706;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", "JetBrains Mono", "Menlo", "Consolas", monospace;

  /* Layout */
  --maxw: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(20, 25, 40, .08);
  --shadow:    0 18px 50px -20px rgba(20, 25, 40, .25);
  --shadow-brand: 0 20px 60px -18px var(--brand-glow);

  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ----- Reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
code, pre, kbd { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--brand); color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 12px; }

/* ----- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; }
.brand-mark img { filter: drop-shadow(0 3px 8px rgba(238,42,36,.25)); }
.brand-name { font-size: 1.24rem; }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  color: var(--text-2); font-weight: 500; font-size: .96rem;
  padding: 8px 13px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.gh-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-2); border-radius: 999px;
  padding: 7px 14px; font-size: .9rem; font-weight: 600; color: var(--text);
  transition: border-color .2s, background .2s, transform .2s;
}
.gh-pill:hover { background: var(--surface-2); border-color: var(--brand); transform: translateY(-1px); }
.gh-count {
  padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--border-2);
  color: var(--text-2); font-variant-numeric: tabular-nums;
}

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--border-2);
  border-radius: 10px; background: transparent; cursor: pointer; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav { display: none; flex-direction: column; border-top: 1px solid var(--border); padding: 10px 24px 18px; }
.mobile-nav a { padding: 12px 6px; color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: 0; }

/* ----- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 1rem; padding: 13px 22px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer; transition: transform .2s var(--ease), box-shadow .25s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn svg { flex: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand) 55%, var(--brand-deep));
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 26px 70px -18px var(--brand-glow); }
.btn-ghost { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--brand); transform: translateY(-2px); background: var(--surface); }

/* ----- Hero --------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px); }
.hero-glow {
  position: absolute; inset: -30% -10% auto -10%; height: 620px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50% 60% at 80% 12%, rgba(242,103,34,.18), transparent 70%),
    radial-gradient(46% 55% at 12% 6%, rgba(238,42,36,.08), transparent 70%);
  filter: blur(6px);
}

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}

.hero-title {
  font-size: clamp(2.7rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 800;
  margin-bottom: 22px;
}
.hero-title .grad {
  background: linear-gradient(120deg, var(--brand-bright), var(--brand) 40%, var(--brand-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tagline { font-size: clamp(1.05rem, 1.7vw, 1.22rem); color: var(--text-2); max-width: 44ch; margin-bottom: 32px; }
.hero-tagline code { color: var(--brand-bright); background: var(--surface-2); padding: 1px 7px; border-radius: 6px; font-size: .9em; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.hero-badges { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.hero-badges li { display: flex; flex-direction: column; gap: 2px; }
.hero-badges .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.hero-badges .v { font-weight: 600; font-size: .95rem; }

/* ----- Terminal window ---------------------------------------------------- */
.terminal {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-2); background: #0b0f17;
  box-shadow: var(--shadow); margin: 0;
}
.hero-visual .terminal { transform: perspective(1600px) rotateY(-4deg) rotateX(2deg); transition: transform .5s var(--ease); }
.hero-visual .terminal:hover { transform: perspective(1600px) rotateY(0) rotateX(0); }
.terminal-bar {
  display: flex; align-items: center; gap: 8px; padding: 11px 15px;
  background: #12161f; border-bottom: 1px solid var(--border);
}
.tdot { width: 12px; height: 12px; border-radius: 50%; }
.tdot.r { background: #ff5f56; } .tdot.y { background: #ffbd2e; } .tdot.g { background: #27c93f; }
.terminal-title { margin-left: 10px; font-family: var(--font-mono); font-size: .78rem; color: #7d879b; }
.terminal-media { width: 100%; height: auto; background: #0b0f17; }
.terminal-body { background: #0b0f17; padding: 18px 20px; overflow-x: auto; }

/* Inline TUI mock (showcase) */
.tui { font-family: var(--font-mono); font-size: .82rem; line-height: 1.7; color: #c8d0e0; white-space: pre; }
.tui-brand { color: var(--brand-bright); font-weight: 700; }
.tui-nav { color: #5c6678; }
.tui-panel { color: #3f495e; }
.tui .ok { color: var(--ok); font-weight: 700; }
.tui .warn { color: var(--warn); font-weight: 700; }
.tui .val { color: #e7ebf3; }
.tui-hint { color: var(--brand-bright); font-weight: 700; }

/* ----- Sections ----------------------------------------------------------- */
.section { padding: clamp(64px, 9vw, 108px) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }

.section-head { max-width: 720px; margin-bottom: 52px; }
.section-eyebrow {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.section-head h2, .section h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
.section-lede { margin-top: 16px; color: var(--text-2); font-size: 1.1rem; }
.section-lede a { color: var(--brand-bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ----- Compare (why it exists) ------------------------------------------- */
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; }
.compare-col { display: flex; flex-direction: column; gap: 12px; }
.compare-label { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; color: var(--text-3); }
.compare-after .compare-label { color: var(--brand); }
.compare-arrow { color: var(--text-3); display: grid; place-items: center; }

.code-block {
  position: relative; background: #0b0f17; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; box-shadow: var(--shadow-sm);
}
.code-block pre { margin: 0; }
.code-block code { font-size: .86rem; line-height: 1.75; color: #c8d0e0; white-space: pre; display: block; }
.code-tui { border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.c-comment { color: #5c6678; }
.c-prompt  { color: var(--term); font-weight: 700; user-select: none; }
.c-str     { color: #f5a623; }
.c-key     { color: var(--brand-bright); font-weight: 700; }
.c-hi      { color: #e7ebf3; font-weight: 600; }
.c-muted   { color: #5c6678; }

.copyable .copy-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-family: var(--font-sans); font-size: .78rem; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.copyable .copy-btn:hover { color: var(--text); border-color: var(--brand); }
.copyable .copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* ----- Pillars ------------------------------------------------------------ */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pillar {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.pillar:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.pillar-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px;
  color: var(--brand-bright);
  background: linear-gradient(150deg, rgba(242,103,34,.16), rgba(238,42,36,.08));
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
}
.pillar h3 { font-size: 1.12rem; margin-bottom: 8px; letter-spacing: -.01em; }
.pillar p { color: var(--text-2); font-size: .95rem; }
.pillar code, .feature code, .section-lede code, .key-list code, .req-body code {
  font-size: .88em; color: var(--brand-bright); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 1px 6px; border-radius: 5px;
}

/* ----- Feature grid ------------------------------------------------------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  grid-column: span 1; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 22px; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.feature::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep)); opacity: 0; transition: opacity .3s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.feature:hover::after { opacity: 1; }
/* Make Dashboard + Consistent UX wider on large grids for rhythm */
.feature-grid .feature:first-child { grid-column: span 2; }
.feature-grid .feature:last-child { grid-column: span 2; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px;
  color: var(--brand-bright); background: var(--surface-2); border: 1px solid var(--border);
}
.feature h3 { font-size: 1.08rem; margin-bottom: 7px; }
.feature p { color: var(--text-2); font-size: .93rem; }

/* ----- Showcase ----------------------------------------------------------- */
.showcase-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.key-list { list-style: none; padding: 0; margin-top: 26px; display: flex; flex-direction: column; gap: 2px; }
.key-list li {
  display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border);
  color: var(--text-2); font-size: .97rem;
}
.key-list li:last-child { border-bottom: 0; }
.key-list span { flex: 1; }
kbd {
  min-width: 26px; text-align: center; font-size: .82rem; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-2); border-bottom-width: 2px;
  border-radius: 7px; padding: 3px 8px; box-shadow: var(--shadow-sm);
}
.terminal-sm .terminal-body { min-height: 320px; }

/* ----- Tabs / install ----------------------------------------------------- */
.tabs { max-width: 900px; }
.tab-list { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  font-family: var(--font-sans); font-size: .96rem; font-weight: 600; color: var(--text-2);
  background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 12px 16px;
  cursor: pointer; transition: color .2s, border-color .2s; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand-bright); border-bottom-color: var(--brand); }
.tab-panel { animation: fade .35s var(--ease); }
.tab-note { color: var(--text-2); margin-bottom: 16px; font-size: .98rem; }
.tab-note code { color: var(--brand-bright); }
.tab-note-muted { margin-top: 14px; color: var(--text-3); font-size: .9rem; }

.req-note { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.req-item {
  border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-sm);
  padding: 18px 20px; background: var(--card);
}
.req-title { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.req-body { color: var(--text-2); font-size: .9rem; }

/* ----- Docs --------------------------------------------------------------- */
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.doc-card {
  display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 26px; transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.doc-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow); }
.doc-card h3 { font-size: 1.14rem; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.doc-card .arr { color: var(--brand); transition: transform .25s var(--ease); }
.doc-card:hover .arr { transform: translateX(5px); }
.doc-card p { color: var(--text-2); font-size: .95rem; }

/* ----- Contribute --------------------------------------------------------- */
.contribute-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: center;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(242,103,34,.10), transparent 60%),
    var(--card);
  border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: clamp(30px, 5vw, 52px);
}
.contribute-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.contribute-list li { display: flex; align-items: flex-start; gap: 12px; color: var(--text-2); font-size: .98rem; }
.ci-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 3px; display: grid; place-items: center; }
.ci-dot.ok { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.ci-dot.ok::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* ----- Footer ------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 40px; background: var(--bg-2); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.footer-tag { color: var(--text-2); margin-top: 14px; max-width: 30ch; font-size: .95rem; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-2); padding: 5px 0; font-size: .95rem; transition: color .2s; }
.footer-col a:hover { color: var(--brand-bright); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 26px; color: var(--text-3); font-size: .88rem; }
.footer-bottom a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.footer-meta { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ver {
  font-family: var(--font-mono); font-size: .8rem; color: var(--brand-bright);
  background: color-mix(in srgb, var(--brand) 14%, transparent); padding: 2px 9px; border-radius: 6px;
}

/* ----- Scroll reveal (progressive enhancement) ---------------------------
   Only hide content when JS is active AND motion is allowed, so the page is
   fully visible without JavaScript or when animations are reduced. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ----- Responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .gh-pill span:not(.gh-count) { display: none; }
  .gh-pill { padding: 8px 12px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual .terminal { transform: none; }
  .showcase-grid { grid-template-columns: 1fr; }
  .contribute-card { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid .feature:first-child,
  .feature-grid .feature:last-child { grid-column: span 2; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding-inline: 18px; }
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); }
  .req-note { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid .feature:first-child,
  .feature-grid .feature:last-child { grid-column: span 1; }
  .hero-cta .btn { flex: 1; justify-content: center; }
}

.mobile-nav.open { display: flex; }
