/* TimeWoven website. "Archive Paper": cream paper, warm ink, one wax-seal red (same tokens as the app). */

:root {
  --paper: #f4eee4;
  --surface: #fbf8f2;
  --sunken: #eae2d5;
  --ink: #221e19;
  --ink-muted: #5e564c;
  --ink-faint: #8c8377;
  --rule: rgba(34, 30, 25, 0.14);
  --seal: #b3312a;
  --stamp-margin: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(34, 30, 25, 0.1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #17140f;
    --surface: #221e18;
    --sunken: #2b261f;
    --ink: #f2ebdf;
    --ink-muted: #bdb3a5;
    --ink-faint: #8a8176;
    --rule: rgba(242, 235, 223, 0.14);
    --seal: #d4483c;
    --stamp-margin: #332d25;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 'Newsreader', Georgia, 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--seal); text-underline-offset: 3px; }
a:hover { color: var(--seal); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; height: auto; display: block; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(680px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 20px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 20px; font-size: 16px; }
.site-nav a { text-decoration: none; color: var(--ink-muted); }
.site-nav a:hover { color: var(--seal); }

/* Catalogue label, like the app's "Artifact No. 0042" */
.label {
  font: 600 12px/1.4 ui-monospace, 'SF Mono', Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Hero */
.hero { padding-block: 64px 48px; display: grid; gap: 48px; grid-template-columns: 1.05fr 0.95fr; align-items: center; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; font-weight: 400; letter-spacing: -0.01em; margin: 12px 0 20px; }
.hero h1 em { font-style: italic; color: var(--seal); }
.hero p.lede { font-size: 21px; color: var(--ink-muted); margin: 0 0 28px; max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  border-radius: 12px; padding: 12px 18px; font: 600 16px/1.2 -apple-system, system-ui, sans-serif;
  text-decoration: none;
}
.badge small { display: block; font-weight: 400; font-size: 11px; opacity: 0.75; }
.badge svg { width: 22px; height: 22px; fill: currentColor; }
.note { font-size: 15px; color: var(--ink-faint); }

/* Before / after */
.transform { position: relative; display: grid; grid-template-columns: 1fr; justify-items: end; }
.photo-card {
  position: absolute; left: 0; bottom: 8%; width: 52%;
  background: var(--stamp-margin); padding: 8px 8px 28px; border-radius: 4px;
  box-shadow: var(--shadow); transform: rotate(-4deg); z-index: 2;
}
.photo-card figcaption { position: absolute; left: 10px; bottom: 6px; font-size: 13px; color: var(--ink-faint); font-style: italic; }
.stamp {
  position: relative; width: 78%; background: var(--stamp-margin); padding: 12px; border-radius: 4px; box-shadow: var(--shadow);
}
/* Perforated edge: small paper-coloured holes punched along all four sides of the stamp. */
.stamp::before {
  content: ''; position: absolute; inset: -5px; pointer-events: none;
  background:
    radial-gradient(circle, var(--paper) 4.5px, transparent 5px) top left / 14px 10px repeat-x,
    radial-gradient(circle, var(--paper) 4.5px, transparent 5px) bottom left / 14px 10px repeat-x,
    radial-gradient(circle, var(--paper) 4.5px, transparent 5px) top left / 10px 14px repeat-y,
    radial-gradient(circle, var(--paper) 4.5px, transparent 5px) top right / 10px 14px repeat-y;
}
.stamp img { border-radius: 2px; aspect-ratio: 2 / 3; object-fit: cover; width: 100%; }
.stamp-caption { margin-top: 10px; text-align: right; width: 78%; }

/* Sections */
section.block { padding-block: 56px; border-top: 1px solid var(--rule); }
section.block h2 { font-size: clamp(30px, 4vw, 40px); font-weight: 400; line-height: 1.15; margin: 8px 0 28px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before {
  content: 'No. 0' counter(step);
  display: block; margin-bottom: 8px;
  font: 600 12px/1.4 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.12em; color: var(--seal);
}
.steps h3 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--ink-muted); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--sunken); box-shadow: var(--shadow); }
.gallery figcaption { margin-top: 10px; }
.gallery figcaption b { display: block; font-weight: 600; }
.gallery figcaption span { color: var(--ink-muted); font-size: 16px; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.facts h3 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.facts p { margin: 0; color: var(--ink-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 28px 40px; font-size: 15px; color: var(--ink-muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* Document pages (privacy, terms, support) */
.doc { padding-block: 48px 64px; }
.doc h1 { font-size: clamp(34px, 5vw, 44px); font-weight: 400; line-height: 1.1; margin: 8px 0 8px; }
.doc .updated { color: var(--ink-faint); font-size: 15px; margin: 0 0 32px; }
.doc h2 { font-size: 23px; font-weight: 600; margin: 2em 0 0.5em; }
.doc table { border-collapse: collapse; width: 100%; font-size: 16px; }
.doc th, .doc td { border-bottom: 1px solid var(--rule); padding: 10px 12px 10px 0; text-align: left; vertical-align: top; }
.doc th { font-weight: 600; }
.doc li + li { margin-top: 6px; }
.doc .contact {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 20px 24px; margin: 24px 0;
}
.doc .contact a { font-size: 22px; }
.doc details { border-bottom: 1px solid var(--rule); padding-block: 14px; }
.doc summary { cursor: pointer; font-weight: 600; font-size: 19px; }
.doc details p { margin: 10px 0 0; color: var(--ink-muted); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 40px; }
  .steps, .facts { grid-template-columns: 1fr; gap: 24px; }
  .gallery { grid-template-columns: 1fr 1fr; gap: 16px; }
  .gallery figure:last-child { display: none; }
  .site-nav a.hide-sm { display: none; }
}
