/* hitoha — website styles. Plain CSS, no build step.
   A quiet page: one column of words, the app's paintings and doodles as the pictures. */

:root {
  --paper: #fbfaf7;
  --paper-2: #f3f0ea;
  --ink: #1c1b19;
  --ink-2: #4f4a45;
  --ink-3: #6c665f;
  --line: #e2ddd5;
  --art-blend: multiply;

  /* Apricot and Harbor, from the app's PaintingTheme.swift */
  --apricot: #b9560a;
  --a1: #b9560a; --a2: #3b8366; --a3: #b8566a; --a4: #986e20; --a5: #a3681a;
  --h1: #4565b5; --h2: #2e7f62; --h3: #796da7; --h4: #6e7230; --h5: #3a5a9e;

  --serif: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --measure: 34rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151413;
    --paper-2: #1c1b19;
    --ink: #f0ece6;
    --ink-2: #c4bdb4;
    --ink-3: #9d968d;
    --line: #2f2c29;
    --art-blend: normal;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
::selection { background: color-mix(in oklab, var(--apricot) 22%, transparent); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Small spaced capitals: the page's one quiet label style */
.label { font: 600 12px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Header ---------- */
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 500 24px/1 var(--serif); letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.bar nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 32px); font-size: 15px; }
.bar nav a { text-decoration: none; color: var(--ink-2); }
.bar nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .bar nav .wide { display: none; } }

/* The App Store button. Disabled until the app is live. */
.store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--ink); color: var(--ink); text-decoration: none;
  font: 500 16px/1 var(--sans);
}
.store svg { width: 17px; height: 17px; fill: currentColor; margin-top: -2px; }
.store[aria-disabled="true"] { cursor: default; }
.store:not([aria-disabled="true"]):hover { background: var(--ink); color: var(--paper); }

/* ---------- Opening ---------- */
.opening { text-align: center; padding: clamp(56px, 10vw, 128px) 0 clamp(48px, 7vw, 88px); }
.opening h1 { font-size: clamp(48px, 8.6vw, 116px); line-height: .98; letter-spacing: -0.035em; }
.opening h1 em { font-style: italic; }
.opening .intro { margin: 28px auto 0; max-width: 30rem; font-size: clamp(18px, 1.8vw, 21px); color: var(--ink-2); }
.opening .label { margin-bottom: 26px; }

/* ---------- A painting with a phone on it ---------- */
.plate { position: relative; margin: 0 auto; max-width: 1240px; padding: 0 var(--gutter); }
.plate .ground { position: relative; overflow: hidden; height: clamp(560px, 64vw, 820px); display: grid; place-items: center; }
.plate .ground > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plate figcaption { margin: 16px auto 0; max-width: var(--measure); text-align: center; color: var(--ink-3); font-size: 14px; }
@media (max-width: 640px) {
  .plate { padding: 0; }
  .plate .ground { height: auto; padding: 56px 0; }
}

.phone {
  --w: clamp(240px, 24vw, 300px);
  position: relative; width: var(--w); aspect-ratio: 9 / 19.4;
  border-radius: calc(var(--w) * .16); padding: calc(var(--w) * .03);
  background: #121110;
  box-shadow: 0 1px 0 1px #2c2a28 inset, 0 50px 80px -30px rgba(30, 18, 6, .45), 0 16px 30px -16px rgba(30, 18, 6, .35);
}
@media (max-width: 640px) { .phone { --w: min(68vw, 280px); } }
.screen {
  container-type: inline-size;
  position: relative; height: 100%; overflow: hidden;
  border-radius: calc(var(--w) * .13);
  background: #faf9f7; color: #1b1a19; font-family: var(--sans);
}
.screen .island { position: absolute; z-index: 3; top: 3.4cqw; left: 50%; translate: -50% 0; width: 30cqw; height: 8.6cqw; border-radius: 99px; background: #0d0d0d; }
.screen .status { position: absolute; z-index: 3; top: 4.8cqw; left: 11cqw; right: 9cqw; display: flex; justify-content: space-between; font: 600 4.6cqw/1 var(--sans); }
.screen .status i { display: inline-block; width: 7.4cqw; height: 3.4cqw; border-radius: 1.2cqw; background: #1b1a19; }
.screen .art { position: absolute; inset: 0 0 auto; height: 47%; }
.screen .art img { width: 100%; height: 100%; object-fit: cover; }
.screen .art::after { content: ""; position: absolute; inset: auto 0 0; height: 16%; background: linear-gradient(transparent, #faf9f7); }
.screen .pill { position: absolute; z-index: 2; top: 17cqw; left: 5cqw; padding: 2.6cqw 4.6cqw; border-radius: 99px; background: rgba(255,255,255,.64); font: 600 4.6cqw/1 var(--sans); }
.screen .round { position: absolute; z-index: 2; top: 15.4cqw; width: 11cqw; height: 11cqw; border-radius: 50%; background: rgba(255,255,255,.64); display: grid; place-items: center; font: 700 4.4cqw/1 var(--sans); }
.screen .round.r { right: 5cqw; } .screen .round.l { left: 5cqw; }
.screen .write { position: absolute; z-index: 2; top: 41.6%; left: 50%; translate: -50% 0; padding: 3.6cqw 7.6cqw; border-radius: 99px; background: var(--apricot); color: #fff; font: 600 4.8cqw/1 var(--sans); white-space: nowrap; }
.screen .month { position: absolute; left: 5.5cqw; right: 5.5cqw; top: 51%; }
.screen .month-head { display: flex; justify-content: space-between; align-items: baseline; }
.screen .month-head b { font: 600 9.4cqw/1 var(--serif); letter-spacing: -0.01em; }
.screen .month-head span { font: 400 4.6cqw/1 var(--serif); color: #7a746d; }
.screen .weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 4cqw; font: 500 3.4cqw/1 var(--sans); color: #8b857d; text-align: center; }
.mini-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 1.4cqw; }
.mini-cal > span { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.mini-cal > span.dot::after { content: ""; width: 9%; aspect-ratio: 1; border-radius: 50%; background: #c9c2b8; }
.mini-cal > span.today::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1.5px solid var(--apricot); }
.mini-cal .mark { position: absolute; inset: 8%; width: 84%; height: 84%; }

/* The page screen: a day's writing */
.screen.page .art { height: 30%; }
.screen.page .art img { -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent); }
.screen.page .art::after { display: none; }
.screen .head { position: absolute; left: 7cqw; right: 7cqw; top: 33cqw; }
.screen .head small { display: block; font: 400 5cqw/1.2 var(--serif); color: #7a736c; }
.screen .head b { display: block; font: 600 9cqw/1.1 var(--serif); margin-top: 1cqw; }
.screen .head span { display: block; margin-top: 2.4cqw; font: 400 3.9cqw/1 var(--sans); color: #847e77; }
.screen .text {
  position: absolute; left: 7cqw; right: 7cqw; top: 70cqw;
  font: 400 6.2cqw/1.7 var(--serif);
  background: linear-gradient(180deg, var(--h1), var(--h2) 30%, var(--h3) 55%, var(--h4) 80%, var(--h5));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Words ---------- */
.words { padding: clamp(88px, 13vw, 168px) 0; }
.column { max-width: var(--measure); margin: 0 auto; }
.column h2 { font-size: clamp(38px, 5vw, 60px); margin-bottom: 28px; }
.column p { color: var(--ink-2); }
.column p + p { margin-top: 18px; }
.column .label { margin-bottom: 20px; }

/* A row of the app's doodles, like marks along a page edge */
.marks { list-style: none; padding: 0; margin: clamp(56px, 8vw, 88px) auto 0; max-width: 760px; display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(8px, 2vw, 24px); }
.marks li { aspect-ratio: 1; }
.mark { width: 100%; height: 100%; overflow: visible; }
.mark.pen { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.mark.outline { fill: currentColor; }
.js .marks .mark.pen { stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s cubic-bezier(.3,.6,.2,1); transition-delay: calc(var(--i) * 120ms); }
.js .marks .mark.outline { opacity: 0; transition: opacity .8s ease; transition-delay: calc(var(--i) * 120ms); }
.js .marks.is-in .mark.pen { stroke-dashoffset: 0; }
.js .marks.is-in .mark.outline { opacity: 1; }
.marks-cap { margin-top: 18px; text-align: center; color: var(--ink-3); font-size: 14px; }
@media (max-width: 560px) { .marks { grid-template-columns: repeat(7, 1fr); gap: 6px; } }

/* ---------- The paintings, hung like a small show ---------- */
.show { padding: clamp(88px, 13vw, 168px) 0 clamp(72px, 10vw, 128px); border-top: 1px solid var(--line); }
.show .column { margin-bottom: clamp(56px, 8vw, 96px); }
.works { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 5vw, 72px); row-gap: clamp(48px, 7vw, 96px); }
.works figure { margin: 0; }
.works img { width: 100%; aspect-ratio: 975 / 885; object-fit: contain; mix-blend-mode: var(--art-blend); }
@media (prefers-color-scheme: dark) { .works img { border-radius: 4px; } }
.works figcaption { margin-top: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.works figcaption b { font: 500 20px/1.2 var(--serif); }
.works figcaption span { font-size: 14px; color: var(--ink-3); font-style: italic; font-family: var(--serif); }
.credit { margin-top: clamp(56px, 8vw, 88px); text-align: center; color: var(--ink-3); font-size: 15px; }
.credit a { color: var(--ink-2); text-underline-offset: 3px; }
@media (max-width: 860px) { .works { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .works { grid-template-columns: 1fr; row-gap: 56px; } .works li { max-width: 340px; margin: 0 auto; width: 100%; } }

/* ---------- Download ---------- */
.get { text-align: center; padding: clamp(96px, 14vw, 176px) 0; background: var(--paper-2); }
.get h2 { font-size: clamp(42px, 6.6vw, 84px); }
.get p { margin: 22px auto 36px; max-width: 26rem; color: var(--ink-2); }

/* ---------- Footer ---------- */
.foot { padding: 32px 0 44px; font-size: 14px; color: var(--ink-3); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 24px; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Gentle arrival of pictures (once, and only if motion is welcome) ---------- */
.js .fade { opacity: 0; transition: opacity 1.2s ease; }
.js .fade.is-in { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js .fade, .js .marks .mark.outline { opacity: 1; transition: none; }
  .js .marks .mark.pen { stroke-dashoffset: 0; transition: none; }
}

/* ---------- Privacy page ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) var(--gutter) 96px; }
.doc h1 { font-size: clamp(42px, 6vw, 64px); margin-bottom: 12px; }
.doc .meta { color: var(--ink-3); margin-bottom: 40px; }
.doc h2 { font-size: 28px; margin: 48px 0 12px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 14px; }
.doc ul { padding-left: 22px; margin: 12px 0; }
.doc li { margin: 6px 0; }
.doc strong { color: var(--ink); }
.draft-note { background: #fff4d6; color: #5a4300; border: 1px solid #f0d58a; border-radius: 12px; padding: 14px 18px; font-size: 15px; margin-bottom: 32px; }
.todo { background: #ffe3a3; color: #4d3800; padding: 0 4px; border-radius: 4px; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .draft-note { background: #2e260f; color: #f1dc9c; border-color: #5a4a1c; }
  .todo { background: #5a4a1c; color: #ffe7a6; }
}
.summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
.summary ul { margin: 8px 0 0; }

/* Side room for the text that sits outside .wrap */
.words { padding-left: var(--gutter); padding-right: var(--gutter); }
.plate figcaption { padding: 0 var(--gutter); }

/* Privacy: the short contents list */
.doc > p + p { margin-top: 14px; }
.doc .summary { margin-top: 28px; }
.toc { margin: 36px 0 8px; }
.toc ol { margin: 10px 0 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.toc li { margin: 4px 0; break-inside: avoid; }
.toc a { color: var(--ink-2); text-underline-offset: 3px; }
.toc a:hover { color: var(--ink); }
.doc h2 { scroll-margin-top: 24px; }
@media (max-width: 560px) { .toc ol { columns: 1; } }
