/* lookpick — washi paper, sumi ink, one touch of vermilion. */
:root {
  --paper: #f5f3ee;
  --card: #fbfaf7;
  --ink: #1b1b1a;
  --mute: #7d7a72;
  --line: #dedad1;
  --shu: #b5432c;
  --serif: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', Georgia, serif;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141413;
    --card: #1b1b19;
    --ink: #ecebe6;
    --mute: #908d85;
    --line: #2f2e2b;
    --shu: #d8694f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141413;
  --card: #1b1b19;
  --ink: #ecebe6;
  --mute: #908d85;
  --line: #2f2e2b;
  --shu: #d8694f;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.7 var(--sans);
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
button { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.mono { font-family: var(--mono); letter-spacing: .04em; }

/* ---------- frame ---------- */
.bar, main, .foot {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .18em;
}
.brand-mark { width: 26px; height: 15px; }
.theme-toggle {
  appearance: none;
  width: 40px; height: 40px;
  margin-right: -10px;
  display: grid; place-items: center;
  border: 0; background: none;
  color: var(--mute);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
main { flex: 1; display: flex; flex-direction: column; }
.foot {
  padding-top: 32px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  color: var(--mute);
  font-size: 11px;
  letter-spacing: .2em;
  text-align: center;
  display: grid;
  gap: 4px;
}
.foot-note { font-size: 10px; letter-spacing: .12em; opacity: .8; }
.note { margin: 12px 0 0; font-size: 11px; color: var(--mute); }

.screen { flex: 1; display: flex; flex-direction: column; animation: fade .5s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
h1 { font-size: clamp(30px, 8.5vw, 38px); line-height: 1.35; letter-spacing: .03em; }
h2 { font-size: clamp(30px, 9vw, 40px); line-height: 1.25; }
.accent { font-style: normal; font-weight: 500; color: var(--shu); }
.lede { color: var(--mute); margin: 20px 0 0; max-width: 34ch; }
.fine { color: var(--mute); font-size: 12px; margin: 20px 0 0; text-align: center; }
.eyebrow { color: var(--shu); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 10px; }

/* ---------- buttons ---------- */
.stack { display: grid; gap: 10px; margin-top: 48px; }
.btn {
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 16px 20px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: .16em;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: transparent; color: var(--ink); }
.btn-quiet { border-color: var(--line); color: var(--mute); }
.btn-quiet:hover { border-color: var(--ink); color: var(--ink); }
.link {
  appearance: none;
  border: 0;
  background: none;
  padding: 12px 4px;
  color: var(--mute);
  font-size: 12px;
  letter-spacing: .16em;
  cursor: pointer;
}
.link:hover:not(:disabled) { color: var(--ink); }
.link:disabled { opacity: .35; cursor: default; }

/* ---------- intro ---------- */
#intro { justify-content: center; padding: 40px 0 8px; }
.hero-mark { display: block; width: 96px; height: 55px; margin: 0 auto 48px; }

/* ---------- quiz ---------- */
#quiz { padding-top: 20px; }
.segs { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.segs i { height: 3px; background: var(--line); transition: background .35s var(--ease); }
.segs i.on { background: var(--shu); }
.segs i.now { background: linear-gradient(90deg, var(--ink) 0 35%, var(--line) 35%); }
.progress-track { display: none; height: 3px; background: var(--line); position: relative; overflow: hidden; }
.progress-fill {
  position: absolute; inset: 0;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform .5s var(--ease);
}
.progress.is-refining .segs { display: none; }
.progress.is-refining .progress-track { display: block; }
.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 28px;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--mute);
  text-transform: uppercase;
}
.cat { display: inline-flex; gap: 10px; align-items: baseline; }
.jp { font-family: var(--serif); font-size: 15px; letter-spacing: .1em; color: var(--ink); text-transform: none; }
.meta-right { display: inline-flex; gap: 12px; align-items: baseline; }
.count { font-family: var(--mono); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.hint { color: var(--shu); animation: fade .5s var(--ease); }

/* Two 3:4 tiles side by side; the "or" sits on the seam at mid-image height. */
.pair {
  --gap: 12px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  container-type: inline-size;
}
.opt {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  width: 100%;
  padding: 0 0 6px;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.ph {
  display: block;
  aspect-ratio: 3 / 4;
  margin-bottom: 10px;
  background: var(--card);
  outline: 1px solid var(--line);
  overflow: hidden;
  transition: outline-color .25s var(--ease), outline-width .1s;
}
.ph img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .4s var(--ease);
}
.ph img.in { opacity: 1; }
.bands { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 18%; }
.bands i { flex: 1; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .2); }
@media (hover: hover) { .opt:hover .ph { outline-color: var(--ink); } }
.opt:active { transform: scale(.985); }
.opt.is-picked .ph { outline: 2px solid var(--ink); }
.opt.is-picked .t { color: var(--shu); }
.opt.is-dropped { opacity: .3; }
.t { font-family: var(--serif); font-size: 16px; line-height: 1.4; }
.d { color: var(--mute); font-size: 12px; line-height: 1.5; }
.or {
  position: absolute;
  left: 50%;
  top: calc((50cqw - var(--gap) / 2) * 2 / 3);
  transform: translate(-50%, -50%);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--serif);
  font-size: 12px;
  color: var(--mute);
  letter-spacing: .05em;
  pointer-events: none;
}
.quiz-actions { display: flex; justify-content: space-between; margin-top: 16px; }
#see { margin-top: 24px; }

/* ---------- the Look Report ---------- */
.report { padding-top: 24px; }
.dash { border: 0; border-top: 1px dashed var(--mute); margin: 10px 0; opacity: .7; }

.rpt-head { border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); padding: 12px 0; margin-bottom: 36px; }
.rpt-row { display: flex; justify-content: space-between; align-items: baseline; }
.rpt-title { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .28em; text-transform: uppercase; }
.rpt-row.mono { font-size: 11px; color: var(--mute); }
#result-title .x { color: var(--shu); font-weight: 400; padding: 0 .1em; }

/* stat tiles */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 36px 0 0;
  border-top: 1px solid var(--ink);
}
.stats > div { padding: 14px 0 16px; border-bottom: 1px dashed var(--line); }
.stats > div:nth-child(odd) { padding-right: 16px; border-right: 1px dashed var(--line); }
.stats > div:nth-child(even) { padding-left: 16px; }
.stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.stats dd { margin: 4px 0 0; display: grid; }
.stats .v { font-family: var(--mono); font-size: 26px; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stats .s { font-size: 11px; color: var(--mute); }

/* figures */
.fig { margin: 44px 0 0; }
.fig figcaption {
  display: flex; gap: 12px; align-items: baseline;
  padding-bottom: 10px; margin-bottom: 18px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
}
.fig figcaption span:first-child { color: var(--shu); }
.fig figcaption span:last-child { color: var(--mute); }

.donut-wrap { display: grid; gap: 20px; }
.donut { width: min(100%, 260px); margin: 0 auto; display: block; overflow: visible; }
.donut .ring { fill: none; stroke: var(--line); stroke-dasharray: 2 3; }
.donut .ticks path { stroke: var(--mute); stroke-width: .8; }
.donut .seg { stroke: var(--paper); stroke-width: 2; cursor: default; transition: opacity .2s var(--ease); outline: none; }
.donut .seg.dim { opacity: .25; }
.donut .annot { fill: none; stroke: var(--shu); stroke-width: 2; stroke-linecap: round; }
.donut .c-v { font-family: var(--mono); font-size: 26px; fill: var(--ink); }
.donut .c-k { font-family: var(--mono); font-size: 8px; letter-spacing: .24em; fill: var(--mute); }

.legend, .menu-list { list-style: none; padding: 0; margin: 0; }
.legend li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  transition: opacity .2s var(--ease);
}
.legend li.dim { opacity: .35; }
.legend li.top .item { color: var(--shu); }
.tx { width: 12px; height: 12px; flex: none; align-self: center; outline: 1px solid var(--line); outline-offset: 1px; }
.leader { flex: 1; min-width: 16px; border-bottom: 1px dotted var(--mute); transform: translateY(-4px); opacity: .7; }
.num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.num::after { content: '%'; color: var(--mute); margin-left: 1px; }

/* position scales */
.scales { display: grid; gap: 22px; }
.scale-labels { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.scale-labels .mono { color: var(--ink); font-size: 12px; }
.scale-line {
  position: relative; height: 14px; margin-top: 6px;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(var(--mute), var(--mute)) center / 100% 1px no-repeat;
  background-image: repeating-linear-gradient(90deg, var(--mute) 0 3px, transparent 3px 6px);
  background-size: 100% 1px;
  background-position: center;
}
.scale-line i { width: 1px; height: 7px; background: var(--mute); }
.scale-line i:nth-child(3) { height: 12px; background: var(--ink); }
.scale-line b {
  position: absolute; top: 50%;
  left: calc(var(--v) * 100%);
  width: 11px; height: 11px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--shu);
  box-shadow: 0 0 0 3px var(--paper);
}

/* table */
.data { width: 100%; border-collapse: collapse; font-size: 12px; }
.data th, .data td { padding: 8px 0; border-bottom: 1px dashed var(--line); text-align: right; font-family: var(--mono); font-weight: 400; font-variant-numeric: tabular-nums; }
.data thead th { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); border-bottom: 1px solid var(--ink); }
.data th[scope="row"], .data thead th:first-child { text-align: left; font-family: var(--sans); }
.data th[scope="row"] { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.data tr.top th[scope="row"] { color: var(--shu); }

/* menu sections */
.menu { margin-top: 44px; }
.menu h3 {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--serif); font-size: 20px;
  padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 3px double var(--ink);
}
.menu h3 .mono { font-size: 10px; letter-spacing: .2em; color: var(--mute); }
.menu-list li { border-bottom: 1px dashed var(--line); }
.menu-list li, .menu-list a { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; text-decoration: none; }
.menu-list li:has(a) { padding: 0; }
.menu-list a { flex: 1; }
.menu-list .no { font-family: var(--mono); font-size: 11px; color: var(--shu); }
.menu-list .item { font-family: var(--serif); font-size: 17px; }
.menu-list .tag { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.menu-list .arrow { color: var(--mute); transition: transform .25s var(--ease), color .25s var(--ease); }
.menu-list a:hover .arrow { color: var(--shu); transform: translate(2px, -2px); }

/* stamp */
.stamp {
  margin-top: 44px; padding: 16px;
  border: 1px dashed var(--mute);
  display: grid; gap: 12px; justify-items: center; text-align: center;
}
.stamp p { margin: 0; font-size: 10px; line-height: 1.8; color: var(--mute); letter-spacing: .1em; }
.barcode { display: flex; gap: 1px; height: 28px; }
.barcode i { background: var(--ink); }

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