/* Shared styling for Tape's inner pages (everything except the landing page,
   which keeps its own inline styles). Same olive palette as the app. */

:root {
  --bg: #F5F4EA;
  --panel: #EFECD8;
  --card: #FBFAEF;
  --ink: #4D523D;
  --muted: #7A7F66;
  --accent: #7D8E2E;
  --accent-deep: #6E7C2B;
  --divider: #D0CCB0;
  --selection: #D8DEC7;
  --shadow: 0 18px 50px -18px rgba(77, 82, 61, .35);
  --btn-bg: #6E7C2B;
  --btn-fg: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1E1F1A;
    --panel: #26271F;
    --card: #2C2D24;
    --ink: #DDE0CE;
    --muted: #8B9077;
    --accent: #A6C838;
    --accent-deep: #B4CD55;
    --divider: #3A3C30;
    --selection: #3E4430;
    --shadow: 0 18px 50px -18px rgba(0, 0, 0, .6);
    --btn-bg: #A6C838;
    --btn-fg: #1B1C16;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--selection); }
html { scroll-behavior: smooth; }
body {
  font-family: "Instrument Sans", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: "Source Serif 4", Georgia, serif; }

/* Paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
main, header, footer { position: relative; z-index: 1; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
nav { display: flex; align-items: center; gap: 20px; padding: 18px 0; }
nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.15rem; text-decoration: none; color: var(--ink); font-family: "Source Serif 4", serif; }
nav .logo img { width: 34px; height: 34px; border-radius: 8px; }
nav .links { margin-left: auto; display: flex; gap: 22px; align-items: center; }
nav .links a { color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500; }
nav .links a:hover { color: var(--accent-deep); }
nav .links a.btn-primary, nav .links a.btn-primary:hover { color: var(--btn-fg); }
@media (max-width: 720px) { nav .links a:not(.dl) { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border-radius: 12px; padding: 14px 26px; font-size: 1.02rem; font-weight: 600;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); box-shadow: 0 8px 24px -8px var(--accent); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--divider); color: var(--ink); background: var(--card); }
.btn-ghost:hover { transform: translateY(-2px); }

/* ---------- Page head ---------- */
.page-head { padding: 52px 0 8px; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep);
  border: 1px solid var(--divider); border-radius: 999px; padding: 5px 14px;
  background: var(--card); margin-bottom: 18px;
}
h1 { font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -.01em; margin-bottom: 16px; }
.lede { font-size: 1.12rem; color: var(--muted); }

/* ---------- Body copy ---------- */
section { padding: 34px 0 0; }
h2 { font-size: 1.5rem; margin: 22px 0 10px; }
h3 { font-size: 1.1rem; margin: 26px 0 8px; }
p { margin-bottom: 12px; }
a { color: var(--accent-deep); }
ul, ol { margin: 0 0 14px 22px; }
li { margin-bottom: 6px; }
strong { font-weight: 600; }
.muted { color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: 14px; padding: 20px 22px; margin: 18px 0;
}
.card h3 { margin-top: 0; }
.note {
  border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: 8px; padding: 14px 18px; margin: 18px 0; font-size: .96rem;
}
.note p:last-child { margin-bottom: 0; }

pre {
  background: var(--panel); border: 1px solid var(--divider); border-radius: 10px;
  padding: 14px 16px; margin: 12px 0 16px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; line-height: 1.7;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
p code, li code, td code { background: var(--panel); border-radius: 5px; padding: 1px 5px; }
.tree .c { color: var(--muted); }
.dir { color: var(--accent-deep); font-weight: 600; }

table { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: .94rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .84rem; text-transform: uppercase; letter-spacing: .06em; }
.table-scroll { overflow-x: auto; }
.badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--selection); color: var(--accent-deep);
  border-radius: 5px; padding: 2px 7px; margin-left: 6px; white-space: nowrap;
}

/* Numbered steps */
.steps { counter-reset: step; list-style: none; margin-left: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 38px; margin-bottom: 14px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-deep); color: var(--btn-fg);
  font-size: .82rem; font-weight: 600; display: grid; place-items: center;
}

/* Screenshot figures */
figure { margin: 26px 0 34px; }
figure img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; border: 1px solid var(--divider); box-shadow: var(--shadow);
}
figcaption { margin-top: 12px; font-size: .92rem; color: var(--muted); }

/* FAQ disclosure */
details {
  background: var(--card); border: 1px solid var(--divider);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 12px;
}
details summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--accent-deep); font-size: 1.2rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 12px 0 0; color: var(--muted); }
details ul { margin-top: 10px; color: var(--muted); }

/* Call to action at the end of a page */
.cta {
  background: var(--panel); border: 1px solid var(--divider); border-radius: 16px;
  padding: 30px 28px; margin: 44px 0 0; text-align: center;
}
.cta h2 { margin-top: 0; }
.cta .fineprint { margin-top: 14px; font-size: .85rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer { margin-top: 72px; border-top: 1px solid var(--divider); padding: 60px 0 40px; color: var(--muted); font-size: .92rem; }
footer a { color: var(--muted); text-decoration: none; transition: color .15s ease; }
footer a:hover { color: var(--accent-deep); }
.foot-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1.25fr; gap: 44px 32px; }
.foot-brand { max-width: 360px; }
.foot-brand .mark { display: flex; align-items: center; gap: 13px; }
.foot-brand .mark img { width: 46px; height: 46px; border-radius: 11px; }
.foot-brand .name { font-family: "Source Serif 4", Georgia, serif; font-size: 1.35rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.foot-brand .tagline { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; margin-top: 4px; }
.foot-brand p { margin-top: 18px; font-size: .9rem; line-height: 1.65; }
.foot-col h4 { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; margin-bottom: 16px; }
.foot-col ul { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.foot-col li { margin: 0; }
.foot-col li a { font-size: .95rem; }
.foot-col .small { margin-top: 16px; font-size: .8rem; line-height: 1.6; opacity: .8; }
.foot-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--divider);
}
.foot-bottom .copy { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; } }
