/* Filewinch site. One stylesheet, system fonts, light and dark from prefers-color-scheme. */

:root {
  color-scheme: light dark;
  --bg: #f7f9f9;
  --bg-tint: #eef5f4;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --text: #142120;
  --muted: #4b5b59;
  --border: #d9e2e0;
  --border-strong: #b9c7c5;
  --accent: #0b6e68;          /* links, focus: 5.9:1 on white */
  --accent-fill: #0d7f78;     /* buttons: white text 4.9:1 */
  --accent-fill-hover: #0a6b65;
  --on-accent: #ffffff;
  --accent-soft: #dff1ee;
  --tab-on: #ffffff;
  --warn-bg: #fff6e0;
  --warn-text: #6b4a00;
  --shadow: 0 1px 2px rgb(16 40 38 / 0.06), 0 12px 40px -12px rgb(16 40 38 / 0.22);
  --shadow-sm: 0 1px 2px rgb(16 40 38 / 0.08);
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, "Cantarell", "Ubuntu", "Noto Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1312;
    --bg-tint: #10201e;
    --surface: #141c1b;
    --surface-2: #1a2423;
    --text: #e6eeed;
    --muted: #a2b2b0;
    --border: #273432;
    --border-strong: #3a4a48;
    --accent: #5fcfc1;
    --accent-fill: #3fb6a8;
    --accent-fill-hover: #5cc8ba;
    --on-accent: #04211f;
    --accent-soft: #123331;
  --tab-on: #2e3d3b;
    --warn-bg: #2d2611;
    --warn-text: #f0d48a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 50px -16px rgb(0 0 0 / 0.7);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.6vw, 3.9rem); font-weight: 750; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.5rem); font-weight: 720; }
h3 { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, kbd { white-space: nowrap; font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0.05em 0.35em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: 12px; z-index: 10; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); transform: translateY(-200%); visibility: hidden; }
.skip:focus { transform: none; visibility: visible; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 7px 11px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 520; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.site-nav .nav-cta a { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; margin-left: 6px; }
.site-nav .nav-cta a:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
@media (max-width: 640px) {
  .site-nav .opt { display: none; }
  .site-nav a { padding: 7px 8px; }
  .brand span { font-size: 1rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 11px;
  font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, border-color .15s, transform .15s;
}
.btn-primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-fill-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-small { min-height: 38px; padding: 7px 14px; font-size: 0.93rem; border-radius: 9px; }
.btn[aria-disabled="true"] { opacity: 0.75; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .sub { font-weight: 450; opacity: 0.85; font-size: 0.88em; }

/* Hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; background: radial-gradient(1200px 500px at 50% -10%, var(--bg-tint), transparent 70%); }
.hero .intro { text-align: center; max-width: 820px; margin: 0 auto; }
.hero .app-icon { width: 96px; height: 96px; margin: 0 auto 18px; }
.lede { font-size: clamp(1.08rem, 2.1vw, 1.28rem); color: var(--muted); max-width: 680px; margin: 0 auto 1.6em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.cta-note { color: var(--muted); font-size: 0.93rem; margin-top: 14px; }
.kicker { display: inline-block; font-size: 0.82rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* Showcase (tabbed screenshots) */
.showcase { margin: clamp(36px, 6vw, 60px) auto 0; max-width: 1120px; }
.tablist { display: none; }
.js .tablist {
  display: flex; width: max-content; max-width: 100%; margin: 0 auto 18px; padding: 4px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
}
.tablist button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: 560 0.94rem/1 var(--font); padding: 9px 16px; border-radius: 8px; cursor: pointer; min-height: 36px;
  display: inline-flex; align-items: center; gap: 7px;
}
.tablist button:hover { color: var(--text); }
.tablist button[aria-selected="true"] { background: var(--tab-on); color: var(--text); box-shadow: var(--shadow-sm); }
.tablist svg { width: 16px; height: 16px; }
.frame {
  border-radius: 12px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.frame img { width: 100%; height: auto; }
.caption { text-align: center; color: var(--muted); font-size: 0.93rem; margin-top: 14px; }

/* Sections */
section { scroll-margin-top: 70px; }
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { max-width: 720px; margin: 0 auto clamp(32px, 5vw, 52px); text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.band { background: var(--surface); border-block: 1px solid var(--border); }

/* Protocol grid */
.protocols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.protocols li {
  display: flex; gap: 13px; align-items: flex-start; padding: 15px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.protocols svg { width: 26px; height: 26px; flex: none; color: var(--accent); margin-top: 1px; }
.protocols strong { display: block; font-size: 0.98rem; font-weight: 640; }
.protocols span { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

/* Feature rows */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature + .feature { margin-top: clamp(64px, 9vw, 110px); }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip > .copy { order: 2; }
.feature .copy p { color: var(--muted); }
.feature ul.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 28px; margin: 0.45em 0; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 17px; height: 17px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-5' fill='none' stroke='%230d7f78' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .ticks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-5' fill='none' stroke='%235fcfc1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip > .copy { order: 0; }
}

/* Small feature cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) { .protocols { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .protocols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .protocols, .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 12px; }
.card p { color: var(--muted); margin: 0; font-size: 0.96rem; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 900px; margin: 0 auto; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent-fill); box-shadow: 0 0 0 1px var(--accent-fill), var(--shadow); }
.plan h3 { font-size: 1.2rem; margin-bottom: 4px; }
.price { font-size: 2.6rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; margin: 10px 0 2px; }
.price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .fine { color: var(--muted); font-size: 0.9rem; }
.plan .ticks { flex: 1; margin: 16px 0 22px; padding: 0; list-style: none; }
.plan .btn { width: 100%; }

/* Download cards */
.dl-status { text-align: center; color: var(--muted); min-height: 1.6em; margin: 0 auto 26px; max-width: 680px; }
.dl-status[data-state="error"], .dl-status[data-state="none"] { color: var(--text); }
.dl-status button { margin-left: 8px; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 920px) { .platforms { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; } }
.platform { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; }
.platform.is-yours { border-color: var(--accent-fill); box-shadow: 0 0 0 1px var(--accent-fill), var(--shadow); }
.platform .yours { display: none; position: absolute; top: -12px; left: 22px; background: var(--accent-fill); color: var(--on-accent); font-size: 0.78rem; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.platform.is-yours .yours { display: inline-block; }
.platform header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.platform header svg { width: 30px; height: 30px; color: var(--accent); }
.platform h2 { font-size: 1.4rem; margin: 0; }
.platform .req { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }
.platform .buttons { display: grid; gap: 10px; margin-top: auto; }
.platform .buttons .btn { justify-content: space-between; text-align: left; }
.platform .meta { color: var(--muted); font-size: 0.85rem; margin: 14px 0 0; }
.dl-extra { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* Prose pages */
.page-head { padding: clamp(48px, 7vw, 84px) 0 clamp(20px, 3vw, 32px); }
.page-head p { color: var(--muted); font-size: 1.12rem; }
.prose { padding-bottom: clamp(56px, 8vw, 96px); }
.prose h2 { font-size: 1.45rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose ol, .prose ul { padding-left: 1.3em; }
.note { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent-fill); border-radius: var(--radius-sm); padding: 16px 18px; margin: 1.4em 0; }
.note p:last-child { margin: 0; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 10px 0; }
summary { cursor: pointer; padding: 15px 18px; font-weight: 620; list-style-position: inside; }
details > div { padding: 0 18px 4px; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 6px 46px; margin: 0 0 14px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.95rem; }

/* Open-source band */
.oss { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.oss svg { width: 48px; height: 48px; color: var(--accent); }
.oss p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .oss { grid-template-columns: 1fr; text-align: left; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0 40px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* 404 */
.lost { text-align: center; padding: clamp(80px, 14vw, 160px) 0; }
.lost img { width: 88px; height: 88px; margin: 0 auto 20px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer, .tablist { display: none; }
}

@media (max-width: 560px) {
  .card { display: grid; grid-template-columns: 28px 1fr; column-gap: 14px; padding: 18px; }
  .card svg { margin: 0; grid-row: span 2; }
  .card h3 { margin-bottom: 4px; }
}
.dl-extra .note { margin: 0; }
