/* hitokuji.com: the app's type scale and colours (src/styles/tokens.css),
   light and dark. Pages come from scripts/site-template.mjs. */

:root {
  --page: #F6F6F6;
  --surface: #FAFAFA;
  --subtle: #F3F3F3;
  --hairline: #E2E2E2;
  --ink: #151514;
  --text: #151514;
  --secondary: #5E5E5A;
  --muted: #71706B;
  --primary: #151514;
  --on-primary: #FFFFFF;
  --photo-blend: multiply;
  --font-jp: 'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --font-en: 'Geist', system-ui, sans-serif;
  --ease: cubic-bezier(.3, .6, .3, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #151514;
    --surface: #1D1D1C;
    --subtle: #252524;
    --hairline: #2C2C2A;
    --ink: #E8E7E1;
    --text: #CFCEC8;
    --secondary: #A9A8A2;
    --muted: #8F8E88;
    --primary: #DEDDD7;
    --on-primary: #151514;
    --photo-blend: normal;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.jp { font-family: var(--font-jp); }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 500; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.photo { mix-blend-mode: var(--photo-blend); }

/* Tracked caps labels, as in the app. */
.label {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--secondary);
}

/* The menu: the app's tab bar, a kanji over its name in tracked caps. On
   phones it sits at the bottom of the screen, as in the app. */
.tabs { display: grid; grid-template-columns: repeat(5, minmax(72px, auto)); gap: 4px; }
.tab {
  min-height: 56px;
  padding: 0 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-on { background: var(--subtle); color: var(--ink); }
.tab-k { font-size: 17px; white-space: nowrap; }
.tab-name { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* Header and footer */
.top, .foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
}
.brand .jp { font-weight: 300; font-size: 20px; }
.foot nav a { font-size: 15px; color: var(--secondary); text-decoration: none; }
.foot nav a:hover { color: var(--ink); }
.foot p a { color: inherit; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.foot p a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.foot {
  border-top: 1px solid var(--hairline);
  margin-top: 48px;
  padding-top: 32px;
  padding-bottom: 48px;
  font-size: 14px;
  color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Buttons */
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 17px;
  text-decoration: none;
  transition: opacity 200ms var(--ease);
}
.button:hover { opacity: .88; }
.note { font-size: 14px; color: var(--muted); }
.soon { font-size: 15px; color: var(--secondary); }
/* Apple's App Store badge, at its own artwork (black, white type, grey edge). */
.store { display: inline-flex; transition: opacity 200ms var(--ease); }
.store:hover { opacity: .88; }
.store img { display: block; height: 44px; width: auto; }
.store-play img { height: 65.5px; margin: -10.7px; }
.stores { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Phones: a rounded bezel around the screen. Sizes inside the screen are
   in container units, so the status bar and corners scale with the phone. */
.phone {
  margin: 0;
  width: 100%;
  max-width: 300px;
  padding: 3.2%;
  border-radius: 15% / 7%;
  background: #1a1a19;
  box-shadow: inset 0 0 0 1.5px #3a3a38, 0 30px 60px -28px rgba(0, 0, 0, .35);
}
.phone-screen {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 393 / 852;
  /* An iPhone's screen corners (about 49pt on a 393 × 852pt screen); a
     container can't size its own corners in its own cqw units. */
  border-radius: 12.5% / 5.75%;
  overflow: hidden;
  background: #F6F6F6;
  --status-ink: #151514;
}
.phone-screen picture, .phone-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.phone-status {
  position: absolute;
  inset: 0 0 auto;
  height: 15cqw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: var(--status-ink);
  font-family: -apple-system, 'SF Pro Text', var(--font-en);
}
.phone-time { justify-self: center; font-size: 4.3cqw; font-weight: 600; letter-spacing: -.01em; }
.phone-island { width: 32cqw; height: 9.4cqw; border-radius: 99px; background: #000; }
.phone-icons { justify-self: center; display: flex; }
.phone-icons svg { width: 15.5cqw; height: auto; }
.phone-home {
  position: absolute;
  left: 50%;
  bottom: 2cqw;
  width: 34cqw;
  height: 1.3cqw;
  border-radius: 99px;
  background: var(--status-ink);
  transform: translateX(-50%);
}
@media (prefers-color-scheme: dark) {
  .phone { background: #0b0b0b; box-shadow: inset 0 0 0 1.5px #2e2e2c, 0 0 0 1px var(--hairline), 0 30px 60px -28px rgba(0, 0, 0, .7); }
  .phone-screen { background: #151514; --status-ink: #E8E7E1; }
}

/* Home */
.home { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.home section { padding: 72px 0; }
.home section + section { border-top: 1px solid var(--hairline); }
.home h1 { font-size: clamp(40px, 6vw, 60px); line-height: 1.08; letter-spacing: -.02em; }
.home h2 { font-size: clamp(28px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -.01em; }
.home h3 { font-size: 17px; }

.lede { font-size: 19px; color: var(--secondary); max-width: 34em; }

.quiet, .price, .last {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.quiet p:not(.label), .price p:not(.label) { max-width: 34em; color: var(--secondary); }
.quiet .photo { width: 120px; }

.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; text-align: center; align-items: center; }
.phones {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.phone-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.phone-card .phone { margin-bottom: 12px; max-width: 260px; }
.phone-card p { color: var(--secondary); font-size: 15px; max-width: 22em; }

.week {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 48px;
}
.week-art { display: flex; justify-content: center; }
.week-text { display: flex; flex-direction: column; gap: 16px; }
.week-text p:not(.label) { color: var(--secondary); max-width: 30em; }

.last .photo { width: 160px; }
.last .cta { align-items: center; }
.last .stores { justify-content: center; }

/* The reading column: privacy, terms, support, delete account. */
.doc { max-width: 680px; margin: 0 auto; padding: 24px 24px 0; }
.doc section { display: flex; flex-direction: column; gap: 16px; }
.doc h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.01em; margin-bottom: 8px; }
.doc h2 { font-size: 20px; margin-top: 20px; }
.doc p { color: var(--text); }
.doc hr { width: 100%; border: 0; border-top: 1px solid var(--hairline); margin: 8px 0; }
.doc section > div { display: flex; flex-direction: column; gap: 4px; }
.doc p:has(+ hr), .doc section > div + p { color: var(--secondary); font-size: 19px; }

/* Story pages: section heads centred, as on a slip; reading columns. */
.part-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 32px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step-no { font-size: 15px; font-weight: 500; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.col { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.col.center { align-items: center; text-align: center; gap: 14px; }
.col.center .photo { width: 180px; height: 180px; object-fit: contain; margin-bottom: 8px; }
.prose { color: var(--secondary); }

/* Footnote numbers after a claim, linking to its sources. */
.refs { font-size: 12px; line-height: 0; margin-left: 2px; white-space: nowrap; }
.refs a { color: var(--muted); text-decoration: none; }
.refs a:hover { color: var(--ink); text-decoration: underline; }

/* The ranks as the app's day strip, the best filled. */
.rank-strip { list-style: none; margin: 0 auto 32px; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.rank-strip li {
  min-width: 112px;
  padding: 16px 12px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.rank-strip li.is-on { background: var(--primary); color: var(--on-primary); }
.rank-k { font-size: 24px; font-weight: 300; white-space: nowrap; }
.rank-en { text-align: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .72; }
/* The objects: a few, with a line each. */
.objects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 32px; }
.objects li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.objects .photo { width: 160px; height: 160px; object-fit: contain; margin-bottom: 8px; }
.object-jp { font-size: 28px; font-weight: 300; }
.object-caption { color: var(--secondary); max-width: 18em; }

/* Omamori: the app's charm tiles. */
.charm-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.charms { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.charms li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px 18px;
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}
.charms img { width: 140px; height: 140px; object-fit: contain; margin-bottom: 4px; }
.charm-month { font-size: 13px; color: var(--muted); }
.charm-jp { margin-top: 4px; font-size: 17px; color: var(--ink); line-height: 1.4; }
.charm-en { font-size: 14px; color: var(--secondary); }
.charms + .note { max-width: 40em; }
.care { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; text-align: center; }
.care li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.care h3 { font-size: 22px; margin-top: 4px; }
.care p:not(.step-no) { color: var(--secondary); max-width: 18em; }

.every { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.every p:not(.label):not(.note) { color: var(--secondary); max-width: 34em; }
.every .photo { width: 160px; height: 160px; object-fit: contain; }
.links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; }

.home .sources h2 { font-size: 13px; letter-spacing: .08em; line-height: 1.4; }
.sources ol { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--secondary); }
.sources .note { margin-top: 16px; }

/* The visit: a night-time opening, full width. */
body { overflow-x: clip; }
.home > .night {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 72px 24px 0;
  background: #2f2f2e;
  color: #E8E7E1;
  border-top: 0;
}
.home > .night + section { border-top: 0; }
.night-in { max-width: 992px; margin: 0 auto; position: relative; z-index: 1; }
.night-text { display: flex; flex-direction: column; gap: 20px; }
.night-side .night-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 48px; padding-bottom: 72px; }
.night-side-art { display: flex; justify-content: center; }
.night-photo { width: 300px; height: auto; }
.night .soon { color: #C9C8C2; }
.night .note { color: #9A9A95; }
.night .button { background: #F4F4F1; color: #151514; }
.night .phone { box-shadow: inset 0 0 0 1.5px #3a3a38, 0 30px 60px -28px rgba(0, 0, 0, .6); }
.night h1 { color: #F4F4F1; }
.night .label, .night .lede { color: #C9C8C2; }
.night .lede { max-width: 34em; }
.night-art { margin: 0 auto; max-width: 1400px; }
.night-art img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 88%, transparent), linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 88%, transparent), linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect;
}
.night-art figcaption { max-width: 992px; margin: 0 auto; padding: 8px 0 24px; font-size: 13px; color: #9A9A95; }

/* The steps as the app's day strip, held at the top while you read. */
.strip {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -24px;
  padding: 12px 24px;
  background: var(--page);
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.strip::-webkit-scrollbar { display: none; }
.strip ol { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 6px; width: max-content; }
.strip li.part-start { margin-left: 14px; }
.strip a {
  min-width: 48px;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.strip a.is-on { background: var(--primary); color: var(--on-primary); }
.strip-k { font-size: 19px; white-space: nowrap; }
.strip-n { font-size: 11px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* Each step like a fortune in the app. */
.visit .steps { gap: 0; }
.visit .step {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  max-width: 520px;
  margin: 0 auto;
  padding: 56px 0;
  scroll-margin-top: 96px;
}
.visit .step + .step { border-top: 1px solid var(--hairline); }
.visit .step-no { text-align: center; font-weight: 500; color: var(--ink); font-size: 15px; letter-spacing: .02em; }
.visit .step-name { display: block; margin: 20px 0 8px; text-align: center; font-size: clamp(44px, 9vw, 80px); font-weight: 300; line-height: 1.15; }
.step-en { text-align: center; color: var(--ink); }
.visit .step .photo { display: block; width: 180px; height: 180px; object-fit: contain; margin: 32px auto 24px; }
.step-story { color: var(--secondary); }
.step-more { margin-top: 12px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Press kit */
.press-icon { width: 180px; height: 180px; border-radius: 40px; }
.facts { display: grid; grid-template-columns: 160px minmax(0, 1fr); max-width: 760px; margin: 0 auto; }
.facts dt, .facts dd { padding: 12px 0; border-bottom: 1px solid var(--hairline); margin: 0; }
.facts dt { color: var(--secondary); font-size: 15px; }
.facts dd { color: var(--ink); }
.press-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.press-shots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.press-shots img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--hairline); }
.press-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.press-cards img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--hairline); }
.press-art { display: block; width: 100%; height: auto; border-radius: 8px; margin-bottom: 24px; }
.press-marks { display: flex; align-items: center; justify-content: center; gap: 40px; padding: 32px; border-radius: 8px; background: #F6F6F6; margin-bottom: 32px; }
.press-marks img:first-child { width: 120px; height: 120px; border-radius: 27px; }
.press-marks img:last-child { width: 240px; height: auto; }

@media (max-width: 760px) {
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .top .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px 8px max(10px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    border-radius: 24px 24px 0 0;
  }
  .tab { padding: 0; }
  .home > .night { padding-top: 48px; }
  .night-art { margin-top: -96px; }
  .night-art figcaption { padding: 8px 0 20px; }
  .visit .step { padding: 44px 0; }
  .home section { padding: 56px 0; }
  .week { grid-template-columns: 1fr; gap: 40px; }
  .night-side .night-in { grid-template-columns: 1fr; gap: 40px; padding-bottom: 56px; }
  .night-photo { width: 200px; }
  .week-art { order: 2; }
  .phones { grid-template-columns: 1fr; gap: 48px; }
  .rank-strip li { min-width: 0; flex: 1 1 calc(33% - 8px); }
  .objects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
  .press-shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .press-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .objects .photo { width: 120px; height: 120px; }
  .charms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charms img { width: 96px; height: 96px; }
  .charm-jp { font-size: 14px; }
  .tab-k { font-size: 14px; }
  .care { grid-template-columns: 1fr; gap: 24px; }
  .phone { max-width: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .store { transition: none; }
}
