/* Quillwork Studio site. Paper & Lagoon tokens: docs/design/brand/style-guide.md.
   Hand-written, no build step. Light by default, dark via prefers-color-scheme.
   Fonts are self-hosted (latin subsets from Google Fonts, SIL OFL 1.1) so no third party sees visitors. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/fredoka-600-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url(/fonts/nunito-latin.woff2) format('woff2');
}

:root {
  color-scheme: light dark;
  --paper: #FBF6EE;
  --paper-deep: #F2EADB;
  --line: #E4D9C5;
  --card: #FFFFFF;
  --ink: #1F2A44;
  --ink-soft: #5E6577;
  --accent: #0B807D;
  --accent-lip: #075C5A;
  --accent-soft: #D7EEEB;
  --on-accent: #FFFFFF;
  --link: #075C5A;          /* accent-lip: 7.6:1 on paper, AA for body-size links */
  --sun: #FFC53D;
  --sun-lip: #D99A0B;
  --good: #18A56C;
  --sky: #5BB8F5;
  --coral: #FF6B57;
  --elev-1: 0 1px 0 rgba(31, 42, 68, .06), 0 4px 12px rgba(31, 42, 68, .10);
  --elev-2: 0 2px 0 rgba(31, 42, 68, .05), 0 10px 28px rgba(31, 42, 68, .16);

  --font-display: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --measure: 68ch;
  --wrap: 1080px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141A2E;
    --paper-deep: #1C2340;
    --line: #2A3352;
    --card: #1E2540;
    --ink: #F4EFE6;
    --ink-soft: #A3ABBF;
    --accent: #3CC6C2;
    --accent-lip: #23928F;
    --accent-soft: #1B3D45;
    --on-accent: #0B2224;
    --link: #5FD3CF;
    --sun: #FFCF5C;
    --sun-lip: #C9971E;
    --good: #2BC184;
    --sky: #6EC3F7;
    --coral: #FF7A68;
    --elev-1: 0 1px 0 rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .30);
    --elev-2: 0 2px 0 rgba(0, 0, 0, .25), 0 10px 28px rgba(0, 0, 0, .45);
  }
}

@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 600 17px/1.6 var(--font-body);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main { flex: 1; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.5rem + 3vw, 3.4rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem); margin-top: 1.6em; }
h3 { font-size: 1.25rem; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: .35em; }
strong { font-weight: 800; }

a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.soft { color: var(--ink-soft); }

.skip {
  position: absolute; left: 8px; top: 8px; z-index: 10; transform: translateY(-200%);
  background: var(--card); color: var(--ink); padding: 10px 16px; border-radius: 12px;
  box-shadow: var(--elev-2); font-weight: 800;
}
.skip:not(:focus) { box-shadow: none; }
.skip:focus { transform: none; }

/* ---------- header / footer ---------- */
.site-header { padding: 18px 0; }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font: 600 1.3rem/1 var(--font-display); letter-spacing: -.01em; min-height: 44px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Header lockup (ADR-0018): Pip writes "Quillwork Studio" with a quill pen. The SVG is
   inlined by tools/site/lockup.mjs; its themed parts follow the tokens. Fixed size from the
   width/height attributes + this rule, so nothing shifts while it animates. */
.brand .lockup { display: block; height: 58px; width: auto; aspect-ratio: 415 / 132; flex: none; }
@media (min-width: 720px) { .brand .lockup { height: 64px; } }
.qw-accent { fill: var(--accent); stroke: var(--accent); }
.qw-accent-lip { fill: var(--accent-lip); }
.qw-soft { fill: var(--ink-soft); }
.qw-ink-fill { fill: var(--ink); }
.qw-ink-stroke { stroke: var(--ink); }

/* The quill "writes live", once per page load: the ink flourish draws itself (its length,
   328 units, comes from tools/site/lockup.mjs) while the pen tilts about its nib in sync.
   Reduced motion: no animation, the finished lockup. */
@media (prefers-reduced-motion: no-preference) {
  .qw-flourish {
    stroke-dasharray: 330 330;
    animation: qw-write 1.05s cubic-bezier(.22, .61, .36, 1) .2s both;
  }
  .qw-pen { animation: qw-pen 1.05s cubic-bezier(.22, .61, .36, 1) .2s both; }
}
@keyframes qw-write {
  from { stroke-dashoffset: 330; }
  to { stroke-dashoffset: 0; }
}
@keyframes qw-pen {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(-10deg); }
  22% { transform: rotate(7deg); }
  34% { transform: rotate(-6deg); }
  48% { transform: rotate(5deg); }
  64% { transform: rotate(-3deg); }
  82% { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

/* Pip waves hello on the home page (decorative). */
.contact-card .pip-wave { display: block; width: 112px; height: 112px; margin: -8px 0 4px -8px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 -10px; padding: 0; list-style: none; }
.nav li + li { margin: 0; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: .98rem;
}
.nav a:hover { background: var(--paper-deep); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 6px; }

.site-footer {
  margin-top: 72px; padding: 28px 0 36px; border-top: 2px solid var(--line);
  color: var(--ink-soft); font-size: .95rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin: 0; }
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin: 0; }

/* ---------- building blocks ---------- */
.hero { padding: 40px 0 16px; }
.lede { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); max-width: 40ch; }
.lede strong { color: var(--ink); }

.card {
  background: var(--card); border-radius: 28px; box-shadow: var(--elev-1);
  padding: 24px; border: 1px solid transparent;
}
@media (prefers-color-scheme: dark) { .card { border-color: var(--line); } }

.app-card {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  text-decoration: none; color: inherit; position: relative;
  transition: transform .12s cubic-bezier(.2, .8, .2, 1), box-shadow .12s;
}
.app-card:hover { transform: translateY(-2px); box-shadow: var(--elev-2); }
.app-card h3 { margin: 0 0 4px; font-size: 1.6rem; }
.app-card p { margin: 0; color: var(--ink-soft); }
.app-card .more { margin-top: 10px; color: var(--link); font-weight: 800; }
.app-icon { width: 96px; height: 96px; border-radius: 22.5%; box-shadow: var(--elev-1); }
.app-icon.lg { width: 128px; height: 128px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; }
.chips li { margin: 0; }
.chip {
  display: inline-flex; align-items: center; min-height: 34px; padding: 4px 14px; border-radius: 18px;
  background: var(--paper-deep); color: var(--ink); font-weight: 800; font-size: .92rem;
}
.chip.sun { background: var(--sun); color: #1F2A44; }

.key {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 22px; border-radius: 18px; border: 0;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 0 var(--accent-lip);
  font: 600 1.15rem/1 var(--font-display); text-decoration: none; letter-spacing: .01em;
  transition: transform 90ms cubic-bezier(.2, .8, .2, 1), box-shadow 90ms;
}
.key:hover { color: var(--on-accent); }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-lip); }
.key.secondary { background: var(--card); color: var(--ink); box-shadow: 0 4px 0 var(--line); }
@media (prefers-color-scheme: dark) { .key.secondary { box-shadow: 0 4px 0 #0A0E1C; } }

.soon {
  display: inline-flex; align-items: center; gap: 12px; margin: 24px 0 0;
  padding: 12px 18px; border-radius: 18px; background: var(--accent-soft); color: var(--ink);
  font-weight: 800;
}
.soon svg { width: 22px; height: 22px; flex: none; color: var(--accent); }

/* ---------- home ---------- */
.studio-hero { display: grid; gap: 8px; padding: 48px 0 24px; }
.studio-hero h1 { max-width: 16ch; }
.grid-2 { display: grid; gap: 24px; }
@media (min-width: 820px) {
  .grid-2 { grid-template-columns: 1.35fr 1fr; align-items: start; }
}
.contact-card h2 { margin-top: 0; font-size: 1.4rem; }
.contact-card p:last-child { margin-bottom: 0; }
.mail { font-weight: 800; font-size: 1.1rem; word-break: break-word; }

.values { display: grid; gap: 16px; padding: 0; margin: 0; list-style: none; }
.values li { margin: 0; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.values svg { width: 28px; height: 28px; color: var(--accent); margin-top: 1px; }

/* ---------- app page ---------- */
.app-hero { display: grid; gap: 28px; padding: 40px 0 8px; align-items: center; }
@media (min-width: 900px) { .app-hero { grid-template-columns: 1.1fr 1fr; } }
.app-hero .title { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.app-hero h1 { margin: 0; }
.app-hero .tagline { font: 600 clamp(1.3rem, 1.1rem + 1vw, 1.7rem)/1.2 var(--font-display); margin: 4px 0 0; color: var(--ink-soft); }
.hero-flags { position: relative; aspect-ratio: 1.25; max-width: 520px; width: 100%; justify-self: center; }
.hero-flags img {
  position: absolute; border-radius: 8px; box-shadow: var(--elev-2);
  background: #fff;
}
.hero-flags .f1 { width: 56%; left: 4%; top: 6%; transform: rotate(-7deg); }
.hero-flags .f2 { width: 46%; right: 2%; top: 0; transform: rotate(6deg); }
.hero-flags .f3 { width: 48%; left: 14%; bottom: 4%; transform: rotate(4deg); }
.hero-flags .f4 { width: 40%; right: 6%; bottom: 10%; transform: rotate(-5deg); }

.shots { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 8px 0 0; padding: 0; list-style: none; }
.shots li { margin: 0; }
.shots figure { margin: 0; }
.phone {
  border-radius: 36px; padding: 10px; background: var(--ink); box-shadow: var(--elev-2);
  max-width: 300px; margin: 0 auto;
}
@media (prefers-color-scheme: dark) { .phone { background: #0A0E1C; outline: 2px solid var(--line); } }
.phone img { border-radius: 27px; width: 100%; }
.shots figcaption { text-align: center; margin-top: 14px; font: 600 1.15rem/1.25 var(--font-display); }
.shots figcaption span { display: block; font: 700 .95rem/1.4 var(--font-body); color: var(--ink-soft); margin-top: 2px; }
.note { font-size: .92rem; color: var(--ink-soft); margin-top: 16px; }

.features { display: grid; gap: 20px; margin-top: 8px; }
@media (min-width: 760px) { .features { grid-template-columns: 1fr 1fr; } }
.features .card h2 { margin-top: 0; font-size: 1.45rem; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 34px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M6.5 11.3l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

.band {
  margin-top: 48px; padding: 32px 24px; border-radius: 28px; background: var(--accent); color: var(--on-accent);
  display: grid; gap: 8px;
}
.band h2 { margin: 0; }
.band p { margin: 0; max-width: 56ch; font-size: 1.08rem; }
.band a { color: inherit; }

/* ---------- document pages (privacy, support) ---------- */
.doc { padding-top: 32px; }
.doc h1 { font-size: clamp(2rem, 1.6rem + 2vw, 2.8rem); }
.doc .meta { color: var(--ink-soft); font-weight: 700; }
.doc h2 { scroll-margin-top: 16px; }
.summary { margin: 24px 0 28px; }
.summary h2 { margin-top: 0; font-size: 1.35rem; }
.toc { padding-left: 1.2em; }
.steps { padding-left: 1.3em; }
.steps li::marker { font-family: var(--font-display); color: var(--accent); }
details {
  background: var(--card); border-radius: 20px; padding: 0 20px; margin: 0 0 12px; box-shadow: var(--elev-1);
}
@media (prefers-color-scheme: dark) { details { border: 1px solid var(--line); } }
summary {
  cursor: pointer; min-height: 56px; display: flex; align-items: center; gap: 12px;
  font: 600 1.1rem/1.3 var(--font-display); list-style: none; padding: 12px 0;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; margin-left: auto; flex: none; width: 12px; height: 12px;
  border-right: 3px solid var(--ink-soft); border-bottom: 3px solid var(--ink-soft);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s;
}
details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
details > :not(summary) { margin-top: 0; }
details[open] { padding-bottom: 8px; }

/* ---------- 404 ---------- */
.lost { text-align: center; padding: 72px 0 24px; }
.lost img { margin: 0 auto 24px; }
.lost p { margin-left: auto; margin-right: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.first { margin-top: 0; }

/* Phones: show the three screens as a swipeable row instead of a tall stack. */
@media (max-width: 640px) {
  .shots {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin: 8px calc(-1 * var(--gutter)) 0; padding: 4px var(--gutter) 16px;
    scroll-padding: 0 var(--gutter);
  }
  .shots li { scroll-snap-align: start; }
  .phone { border-radius: 30px; padding: 8px; }
  .phone img { border-radius: 23px; }
}
@media (max-width: 480px) {
  .app-card { grid-template-columns: 1fr; gap: 14px; }
  .app-icon { width: 80px; height: 80px; }
}
