/* Hutchlet website — shared theme
   Brand teal from BrandPalette.swift: light #1C8F82, dark #4FC7B9.
   Surfaces: light #FAFCFF, dark #1F2429. System font stack for a native macOS feel. */

:root {
  --teal: #1c8f82;
  --teal-strong: #14756a;
  --teal-soft: #e7f5f2;
  --bg: #f6f9fb;
  --surface: #fafcff;
  --surface-2: #ffffff;
  --border: #e2e8ec;
  --ink: #16242a;
  --ink-soft: #43565e;
  --ink-faint: #6c7c83;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(16, 36, 42, .06), 0 8px 24px rgba(16, 36, 42, .06);
  --shadow-lg: 0 24px 60px rgba(16, 36, 42, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* risk badge colors (mirror the app's risk levels) */
  --risk-safe: #2f9e6f;
  --risk-network: #2f6fd0;
  --risk-medium: #c79100;
  --risk-privileged: #d97706;
  --risk-destructive: #d64545;
  --risk-bypass: #b3257a;
}

html[data-theme="dark"] {
  --teal: #4fc7b9;
  --teal-strong: #6fd8cb;
  --teal-soft: #16322e;
  --bg: #15191c;
  --surface: #1f2429;
  --surface-2: #252b31;
  --border: #323a41;
  --ink: #eef3f4;
  --ink-soft: #b6c2c7;
  --ink-faint: #8a979d;
  --accent-ink: #08221f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);

  --risk-safe: #56c08c;
  --risk-network: #6fa0ec;
  --risk-medium: #e3c04e;
  --risk-privileged: #f0a052;
  --risk-destructive: #ef7676;
  --risk-bypass: #de6bab;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 2.2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.8em 0 .4em; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--teal); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: 18px;
  height: 64px; max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a {
  color: var(--ink-soft); font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--ink); background: var(--teal-soft); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--teal); background: var(--teal-soft); }
.nav-cta {
  background: var(--teal) !important; color: var(--accent-ink) !important;
  padding: 8px 16px !important; font-weight: 600 !important;
}
.nav-cta:hover { background: var(--teal-strong) !important; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--ink-soft);
}
.icon-btn:hover { background: var(--teal-soft); color: var(--ink); }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 2px; margin: 0; padding: 12px 16px 18px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); transform: translateY(-130%); transition: transform .22s ease;
  }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  body[data-nav="open"] .nav-links { transform: translateY(0); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 11px; font-weight: 600; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: var(--accent-ink); }
.btn-primary:hover { background: var(--teal-strong); }
.btn-ghost { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- hero ---------- */
.hero { padding: clamp(48px, 9vw, 104px) 0 44px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--teal);
  background: var(--teal-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero p.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-note { margin-top: 16px; font-size: .9rem; color: var(--ink-faint); }
.hero-shot {
  border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  width: 100%; height: auto; background: var(--surface); display: block;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero p.lede { max-width: none; }
}

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section-tealwash { background: linear-gradient(180deg, var(--teal-soft), transparent 80%); }
.section h2 { margin-top: 0; }
.section-intro { color: var(--ink-soft); max-width: 60ch; font-size: 1.05rem; }
.center { text-align: center; }
.center .section-intro { margin-inline: auto; }

/* ---------- feature grid / cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p { color: var(--ink-soft); margin-bottom: 0; }
.card-link { display: block; }
.card-link:hover { text-decoration: none; border-color: var(--teal); transform: translateY(-2px); transition: .15s; }

.feat-ico {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal); margin-bottom: 14px;
}
.feat-ico svg { width: 24px; height: 24px; }

/* ---------- doc / tutorial layout ---------- */
.doc { display: grid; grid-template-columns: 240px 1fr; gap: 44px; padding: 40px 0 72px; align-items: start; }
.sidebar {
  position: sticky; top: 88px; align-self: start;
  font-size: .94rem; border-right: 1px solid var(--border); padding-right: 8px;
}
.sidebar h4 {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); margin: 18px 0 8px;
}
.sidebar a { display: block; color: var(--ink-soft); padding: 6px 10px; border-radius: 8px; }
.sidebar a:hover { background: var(--teal-soft); color: var(--ink); text-decoration: none; }
.sidebar a[aria-current="page"] { color: var(--teal); background: var(--teal-soft); font-weight: 600; }
.doc-body { min-width: 0; }
.doc-body > :first-child { margin-top: 0; }
.doc-body img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.doc-body ul, .doc-body ol { padding-left: 1.3em; }
.doc-body li { margin: .35em 0; }
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.crumbs { font-size: .88rem; color: var(--ink-faint); margin-bottom: 6px; }
.crumbs a { color: var(--ink-faint); }
@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; gap: 8px; }
  .sidebar { position: static; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 12px; margin-bottom: 16px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar h4 { width: 100%; margin: 10px 0 2px; }
}

/* ---------- callouts ---------- */
.note {
  border: 1px solid var(--border); border-left: 4px solid var(--teal);
  background: var(--surface); border-radius: 10px; padding: 14px 18px; margin: 1.4em 0;
}
.note.warn { border-left-color: var(--risk-destructive); }
.note.privacy { border-left-color: var(--risk-safe); }
.note strong { color: var(--ink); }
.note p:last-child { margin-bottom: 0; }

/* ---------- code ---------- */
code {
  font-family: var(--mono); font-size: .9em;
  background: var(--teal-soft); color: var(--teal-strong);
  padding: .12em .4em; border-radius: 6px;
}
html[data-theme="dark"] code { color: var(--teal-strong); }
pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; box-shadow: var(--shadow);
}
pre code { background: none; color: var(--ink); padding: 0; font-size: .88rem; line-height: 1.6; }
kbd {
  font-family: var(--font); font-size: .82em; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: .1em .5em; color: var(--ink);
}

/* ---------- risk badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2em 0; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, transparent);
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.b-safe { color: var(--risk-safe); }
.b-network { color: var(--risk-network); }
.b-medium { color: var(--risk-medium); }
.b-privileged { color: var(--risk-privileged); }
.b-destructive { color: var(--risk-destructive); }
.b-bypass { color: var(--risk-bypass); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.4em 0; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--ink); font-weight: 600; background: var(--teal-soft); }
tbody tr:hover { background: var(--surface); }

/* ---------- steps ---------- */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5em 0; }
ol.steps > li {
  counter-increment: step; position: relative; padding: 2px 0 18px 52px; margin: 0;
}
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal); color: var(--accent-ink); font-weight: 700; font-size: .95rem;
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--border);
}
ol.steps h3 { margin: 4px 0 .3em; font-size: 1.08rem; }
ol.steps p { color: var(--ink-soft); }

/* ---------- pills / meta ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600;
  color: var(--ink-soft); background: var(--surface); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 999px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--teal), var(--teal-strong));
  color: var(--accent-ink); border-radius: 20px; padding: 44px; text-align: center; margin: 16px 0;
}
.cta-band h2 { color: var(--accent-ink); margin-top: 0; }
.cta-band p { color: color-mix(in srgb, var(--accent-ink) 86%, transparent); max-width: 52ch; margin-inline: auto; }
.cta-band .btn-primary { background: var(--accent-ink); color: var(--teal-strong); }
.cta-band .btn-primary:hover { background: #fff; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 44px 0 36px; margin-top: 40px; font-size: .92rem; color: var(--ink-soft);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid h5 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.foot-grid a { display: block; color: var(--ink-soft); padding: 3px 0; }
.foot-grid a:hover { color: var(--teal); }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.foot-brand img { width: 26px; height: 26px; border-radius: 6px; }
.foot-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .86rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

.muted { color: var(--ink-faint); }
.hide-print { }
hr.rule { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }

/* ---------- screenshots ---------- */
figure.shot { margin: 1.6em 0 2em; text-align: center; }
figure.shot img {
  border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  background: var(--surface); max-width: 100%; height: auto;
}
figure.shot.panel img { width: 300px; }
figure.shot.window img { width: 100%; max-width: 580px; }
figure.shot figcaption { margin-top: 12px; font-size: .9rem; color: var(--ink-faint); }

.shot-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; align-items: start; }
.shot-gallery figure { margin: 0; }
.shot-gallery img {
  width: 100%; border-radius: 12px; border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--surface);
}
.shot-gallery figcaption { margin-top: 10px; font-size: .9rem; color: var(--ink-soft); text-align: center; font-weight: 500; }
@media (max-width: 900px) { .shot-gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .shot-gallery { grid-template-columns: 1fr; } }
