/*
 * InkPool website. Five materials, as in the app: a walnut desk, rice paper, sumi ink,
 * vermilion wax and gold leaf. No scripts. Light and night palettes follow the visitor's system.
 */

/* Fonts are served from this site (no third-party requests): Cormorant Garamond and Inter, SIL OFL 1.1 (fonts/OFL-*.txt). */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500 600; font-style: normal; font-display: swap; src: url("fonts/Display-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: italic; font-display: swap; src: url("fonts/Display-MediumItalic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/UI-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/UI-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/UI-SemiBold.woff2") format("woff2"); }


:root {
  --wood: #2e2219;
  --wood-deep: #1e1712;
  --wood-veil: rgba(30, 23, 18, 0);
  --on-wood: #f0e6d3;
  --on-wood-muted: #c9b89d;
  --paper: #efe6d6;
  --paper-raised: #f6f0e5;
  --paper-sunk: #e5dac6;
  --ink: #1c1612;
  --ink-muted: #5a4c40;
  --ink-line: rgba(28, 22, 18, 0.16);
  --seal: #b8331a;
  --seal-deep: #8f2512;
  --on-seal: #fbf3e6;
  --gold: #c9a24a;
  --gold-bright: #ebcb7e;
  --fibre-opacity: 0.55;
  --sheet-shadow: 0 1px 1px rgba(20, 12, 6, 0.25), 0 18px 40px -12px rgba(10, 6, 3, 0.65);
  color-scheme: light;

  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wood: #141011;
    --wood-deep: #0b0809;
    --wood-veil: rgba(15, 11, 8, 0.45);
    --on-wood: #e8dcc6;
    --on-wood-muted: #ae9e86;
    --paper: #3a3027;
    --paper-raised: #453a31;
    --paper-sunk: #2f2620;
    --ink: #ece2d0;
    --ink-muted: #b7a893;
    --ink-line: rgba(236, 226, 208, 0.16);
    --seal: #f07b5e;
    --seal-deep: #c9482c;
    --on-seal: #2a1a14;
    --gold: #c9a24a;
    --gold-bright: #eed38c;
    --fibre-opacity: 0.08;
    --sheet-shadow: 0 1px 1px rgba(0, 0, 0, 0.5), 0 18px 40px -12px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font: 400 1rem/1.65 var(--text);
  color: var(--on-wood);
  background-color: var(--wood-deep);
  background-image: linear-gradient(var(--wood-veil), var(--wood-veil)), url("wood.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* A soft vignette, like lamplight on a desk. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 38%, transparent 45%, rgba(8, 5, 3, 0.5) 100%);
}

.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px;
}

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

a {
  color: inherit;
}

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

.sheet :focus-visible {
  outline-color: var(--seal);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  z-index: 2;
}

.skip:focus {
  top: 12px;
}

/* ---------------------------------------------------------------- paper ---- */

.sheet {
  position: relative;
  background-color: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: var(--sheet-shadow);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("paper-fibre.png") repeat;
  background-size: 256px;
  opacity: var(--fibre-opacity);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.sheet > * {
  position: relative;
}

/* A dry-brush stroke of sumi ink, used as the one divider on every page. */
.brush {
  display: block;
  height: 18px;
  width: min(100%, 22rem);
  margin: 1.4rem auto 1.6rem;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 600 24%22 preserveAspectRatio=%22none%22%3E%3Cdefs%3E%3Cmask id=%22d%22%3E%3Crect width=%22600%22 height=%2224%22 fill=%22%23fff%22/%3E%3Cg fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M140 9.2C250 8.6 380 10.2 520 8.4%22 stroke-width=%22.9%22/%3E%3Cpath d=%22M210 16.6C320 17.2 440 16.4 552 13.4%22 stroke-width=%22.8%22/%3E%3Cpath d=%22M290 12.2C380 11.8 470 12.4 586 7.6%22 stroke-width=%22.7%22/%3E%3Cpath d=%22M380 14.6C460 14.8 520 13.6 596 8.8%22 stroke-width=%221.2%22/%3E%3Cpath d=%22M420 10.6C480 10.4 540 9.4 594 6.2%22 stroke-width=%22.6%22/%3E%3Cpath d=%22M80 15.2C150 15.6 210 15.3 280 15%22 stroke-width=%22.5%22/%3E%3Cpath d=%22M470 17.6C520 17.4 560 15.6 590 12.6%22 stroke-width=%22.9%22/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath mask=%22url%28%23d%29%22 d=%22M3 15C10 9 30 7 70 6.6S180 6 260 7.2 420 9 500 7.8 572 4.6 598 3.4L598.6 5C578 10 548 16 500 18.4S380 20 300 19.6 160 20.2 90 19.6 18 19.2 3 15Z%22/%3E%3Ccircle cx=%22588%22 cy=%2217.2%22 r=%221.2%22/%3E%3Ccircle cx=%22595%22 cy=%2220%22 r=%22.8%22/%3E%3Ccircle cx=%228%22 cy=%2220.6%22 r=%22.7%22/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 600 24%22 preserveAspectRatio=%22none%22%3E%3Cdefs%3E%3Cmask id=%22d%22%3E%3Crect width=%22600%22 height=%2224%22 fill=%22%23fff%22/%3E%3Cg fill=%22none%22 stroke=%22%23000%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M140 9.2C250 8.6 380 10.2 520 8.4%22 stroke-width=%22.9%22/%3E%3Cpath d=%22M210 16.6C320 17.2 440 16.4 552 13.4%22 stroke-width=%22.8%22/%3E%3Cpath d=%22M290 12.2C380 11.8 470 12.4 586 7.6%22 stroke-width=%22.7%22/%3E%3Cpath d=%22M380 14.6C460 14.8 520 13.6 596 8.8%22 stroke-width=%221.2%22/%3E%3Cpath d=%22M420 10.6C480 10.4 540 9.4 594 6.2%22 stroke-width=%22.6%22/%3E%3Cpath d=%22M80 15.2C150 15.6 210 15.3 280 15%22 stroke-width=%22.5%22/%3E%3Cpath d=%22M470 17.6C520 17.4 560 15.6 590 12.6%22 stroke-width=%22.9%22/%3E%3C/g%3E%3C/mask%3E%3C/defs%3E%3Cpath mask=%22url%28%23d%29%22 d=%22M3 15C10 9 30 7 70 6.6S180 6 260 7.2 420 9 500 7.8 572 4.6 598 3.4L598.6 5C578 10 548 16 500 18.4S380 20 300 19.6 160 20.2 90 19.6 18 19.2 3 15Z%22/%3E%3Ccircle cx=%22588%22 cy=%2217.2%22 r=%221.2%22/%3E%3Ccircle cx=%22595%22 cy=%2220%22 r=%22.8%22/%3E%3Ccircle cx=%228%22 cy=%2220.6%22 r=%22.7%22/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* A small wax seal: vermilion with a gold ring, as on the app's envelopes. */
.wax {
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  margin-top: 0.42em;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--gold) 0 18%, var(--seal) 21% 100%);
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* -------------------------------------------------------------- landing ---- */

.landing {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 108px 0 28px;
}

/* Two sheets on the desk: the letter, and one beneath it peeking out. */
.stack {
  display: grid;
  width: min(100%, 35rem);
}

.stack > * {
  grid-area: 1 / 1;
}

.stack .under {
  transform: rotate(1.6deg) translate(6px, 6px);
  background-color: var(--paper-sunk);
}

.letter {
  padding: 0 clamp(22px, 6vw, 56px) clamp(30px, 5vw, 44px);
  text-align: center;
}

.letter .medallion {
  display: block;
  width: 152px;
  height: 152px;
  margin: -76px auto 6px;
  filter: drop-shadow(0 10px 14px rgba(10, 6, 3, 0.45));
}

.letter h1 {
  margin: 0;
  font: 600 clamp(3rem, 9vw, 4.25rem) / 1 var(--display);
  letter-spacing: 0.01em;
}

.tagline {
  margin: 0.55rem auto 0;
  max-width: 22ch;
  font: italic 500 clamp(1.35rem, 3.6vw, 1.6rem) / 1.3 var(--display);
  color: var(--ink-muted);
}

.landing .brush {
  height: 22px;
  width: min(100%, 18rem);
  margin: 1.5rem auto 1.7rem;
}

.features {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 27rem;
  text-align: left;
  display: grid;
  gap: 0.85rem;
}

.features li {
  display: flex;
  gap: 0.85rem;
  font-size: 0.98rem;
  line-height: 1.55;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2rem;
  padding: 0.7rem 1.35rem 0.75rem 1.1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 74, 0.55), 0 6px 14px -8px rgba(0, 0, 0, 0.7);
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.play:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--gold), 0 10px 18px -8px rgba(0, 0, 0, 0.75);
}

.play svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.play span {
  display: grid;
  text-align: left;
  line-height: 1.15;
}

.play small {
  font-size: 0.7rem;
  opacity: 0.8;
}

.play strong {
  font-weight: 600;
  font-size: 1.05rem;
}

.availability {
  margin: 0.8rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* The one moment of motion: the brush paints its stroke as the page opens. */
@media (prefers-reduced-motion: no-preference) {
  .landing .brush {
    animation: paint 1100ms cubic-bezier(0.3, 0.6, 0.2, 1) 250ms both;
  }
}

@keyframes paint {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ----------------------------------------------------------- site chrome ---- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: 22px 0 26px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-bright);
  text-decoration: none;
  font: 600 1.6rem/1 var(--display);
}

.wordmark img {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a,
.footer a {
  color: var(--gold-bright);
  text-decoration: none;
  padding: 6px 0;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 400ms ease;
}

.nav a:hover,
.footer a:hover,
.nav a[aria-current="page"] {
  background-size: 100% 1px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 26px;
  padding: 20px 0 30px;
  font-size: 0.9rem;
  color: var(--on-wood-muted);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 26px;
}

.footer p {
  margin: 0;
  width: 100%;
  text-align: center;
}

/* ------------------------------------------------------------- documents ---- */

.doc {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: clamp(30px, 6vw, 60px) clamp(20px, 6vw, 64px) clamp(36px, 6vw, 64px);
}

.doc > * {
  max-width: var(--measure);
}

.doc h1 {
  margin: 0;
  font: 600 clamp(2.4rem, 7vw, 3.2rem) / 1.05 var(--display);
}

.doc .meta {
  margin: 0.5rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.doc .brush {
  margin: 1.6rem 0 1.8rem;
  width: min(100%, 15rem);
}

.doc h2 {
  margin: 2.6rem 0 0.6rem;
  font: 600 1.75rem/1.15 var(--display);
  scroll-margin-top: 20px;
}

.doc h3 {
  margin: 1.6rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  scroll-margin-top: 20px;
}

.doc p,
.doc li {
  font-size: 1rem;
}

.doc p {
  margin: 0 0 0.9rem;
}

.doc ul,
.doc ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.doc li {
  margin: 0.3rem 0;
}

.doc li::marker {
  color: var(--seal);
}

.doc a {
  text-decoration-line: underline;
  text-decoration-color: var(--seal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.doc a:hover {
  text-decoration-thickness: 2px;
}

.doc code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--paper-sunk);
  overflow-wrap: anywhere;
}

.doc strong {
  font-weight: 600;
}

/* The short version, set apart on a raised slip of paper. */
.summary {
  margin: 0 0 1.6rem;
  padding: 1.1rem 1.3rem 0.4rem;
  background: var(--paper-raised);
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--ink-line);
}

.summary h2 {
  margin-top: 0;
  font-size: 1.45rem;
}

.summary ul {
  list-style: none;
  padding: 0;
}

.summary li {
  display: flex;
  gap: 0.75rem;
}

/* Contents, in two columns where there is room. */
.doc .contents {
  max-width: none;
  margin: 0 0 0.5rem;
  padding-left: 1.7rem;
  columns: 2 14rem;
  column-gap: 3rem;
}

.contents li {
  margin: 0.15rem 0;
  break-inside: avoid;
}

/* A statement quoted in exactly the form a reviewer looks for, sealed in vermilion. */
.statement {
  margin: 1rem 0 1.2rem;
  padding: 1rem 1.2rem 1rem 1.3rem;
  border-left: 3px solid var(--seal);
  background: var(--paper-raised);
  font: 500 1.22rem/1.45 var(--display);
}

.statement p {
  margin: 0;
  font-size: inherit;
}

/* Who receives what: a ledger rather than a table, so it reads on a phone. */
.ledger {
  margin: 0.4rem 0 1.2rem;
  border-top: 1px solid var(--ink-line);
}

.ledger > div {
  padding: 0.85rem 0 0.7rem;
  border-bottom: 1px solid var(--ink-line);
}

.ledger dt {
  font-weight: 600;
}

.ledger dd {
  margin: 0.2rem 0 0;
}

.ledger dd + dd {
  margin-top: 0.35rem;
}

.ledger .when {
  color: var(--ink-muted);
  font-size: 0.93rem;
}

/* FAQ entries open in place. */
.faq details {
  border-top: 1px solid var(--ink-line);
  padding: 0.2rem 0;
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--ink-line);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  font: 600 1.28rem/1.3 var(--display);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 0.62rem;
  height: 0.62rem;
  margin-top: 0.42rem;
  border-right: 1.5px solid var(--seal);
  border-bottom: 1.5px solid var(--seal);
  transform: rotate(45deg);
  transition: transform 300ms ease;
}

.faq details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 0.7rem;
}

.faq details > :not(summary) {
  margin-left: 0;
}

.faq details > p:last-child,
.faq details > ol:last-child,
.faq details > ul:last-child {
  margin-bottom: 1rem;
}

.doc .contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  margin: 0.4rem 0 1.4rem;
  font: 600 1.45rem/1.3 var(--display);
}

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

@media (max-width: 480px) {
  .landing {
    padding-top: 92px;
  }

  .letter .medallion {
    width: 128px;
    height: 128px;
    margin-top: -64px;
  }

  .masthead {
    padding-top: 16px;
  }

  .stack .under {
    transform: rotate(1.2deg) translate(3px, 5px);
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before,
  .masthead,
  .footer,
  .brush,
  .skip {
    display: none;
  }

  .sheet {
    box-shadow: none;
    background: #fff;
    color: #000;
  }

  .sheet::before {
    display: none;
  }
}
