/* tear.report: one stylesheet for the landing, personal and tablet pages. */
:root {
  --ink: #15171c;
  --ink-2: #2d3038;
  --text: #3a3d45;
  --muted: #73757c;
  --faint: #a3a199;
  --paper: #f3f1eb;
  --paper-2: #eceae4;
  --card: #fffdf8;
  --line: #e1ddd3;
  --line-soft: #ebe7de;
  --ember: #e2662a;
  --ember-deep: #a83c0c;
  --glow: #fbe4c6;
  --mark-hl: #f5d77a;
  --link: #1c5cab;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(21, 23, 28, .05), 0 10px 30px -12px rgba(21, 23, 28, .16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  height: 60px;
}
.mark {
  display: inline-flex; align-items: center; gap: 11px; min-height: 44px; text-decoration: none; color: #fff;
  font: 600 1.2rem/1 var(--serif); letter-spacing: .2em;
}
.mark svg { width: 26px; height: 26px; }
.langs { display: flex; gap: 2px; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 3px; }
.langs button {
  min-width: 48px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: none;
  color: rgba(255, 255, 255, .62); font-weight: 600; font-size: .92rem; letter-spacing: .06em; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: #fff; color: var(--ink); }

/* ---------- shared ---------- */
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }
.kicker {
  font: 500 .74rem/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; margin: 0; }
h1 { font-size: clamp(2.05rem, 7.6vw, 3.2rem); line-height: 1.08; }
h1 em { font-style: italic; color: var(--ember-deep); }
.lede { color: var(--text); font-size: 1.06rem; margin: 18px 0 0; max-width: 34em; }
.label-row { display: flex; align-items: center; gap: 12px; margin: 44px 0 16px; }
.label-row .kicker { margin: 0; white-space: nowrap; }
.label-row::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 12px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 1.02rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.wide { width: 100%; }

/* ---------- form ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 22px 22px;
}
.panel h2 { font-size: 1.6rem; line-height: 1.15; }
.panel .sub { color: var(--muted); margin: 8px 0 20px; font-size: .98rem; }
.field { display: block; margin: 0 0 14px; }
.field span { display: block; font-size: .86rem; color: var(--muted); margin: 0 0 6px; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line);
  background: #fff; font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(21, 23, 28, .08); }
.field input[aria-invalid="true"] { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(226, 102, 42, .14); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { color: var(--ember-deep); font-size: .94rem; margin: 2px 0 14px; min-height: 0; }
.fine { color: var(--muted); font-size: .84rem; line-height: 1.5; margin: 14px 0 0; display: flex; gap: 9px; }
.fine svg { flex: none; margin-top: 3px; }
.count { color: var(--faint); font-size: .84rem; text-align: right; margin: -8px 0 12px; }
.done { text-align: left; }
.done .tick {
  width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; margin-bottom: 16px;
}
.done p { color: var(--text); margin: 10px 0 0; }
.linkish {
  background: none; border: 0; padding: 0; min-height: 44px; color: var(--link); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; font-size: .96rem;
}

/* ---------- report cards ---------- */
.cards { display: grid; gap: 14px; }
.card {
  position: relative; display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 18px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 2px rgba(21, 23, 28, .04);
}
.card .for { font: 500 .7rem/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card .for b { color: var(--ember-deep); font-weight: 600; }
.card h3 { font-size: 1.34rem; line-height: 1.2; margin: 8px 0 8px; }
.card p { margin: 0; color: var(--text); font-size: .96rem; line-height: 1.5; }
.card .row { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); font: 600 .72rem/1 var(--sans); letter-spacing: .08em; color: var(--muted);
}

.card.locked .lock {
  position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper-2); display: grid; place-items: center; color: var(--muted);
}
.card.locked h3, .card.locked .for { padding-right: 40px; }
.veil { margin-top: 16px; display: flex; gap: 10px; align-items: center; filter: blur(3.2px); opacity: .7; user-select: none; }
.veil i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ember), var(--glow)); }
.veil b { font: 600 1.1rem/1 var(--sans); color: var(--ink); }

/* ---------- footer ---------- */
.foot {
  margin-top: 56px; padding: 26px 20px calc(30px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  color: var(--muted); font-size: .84rem; text-align: center;
}
.foot b { font-family: var(--serif); letter-spacing: .16em; color: var(--ink); font-weight: 600; }

/* ---------- landing ---------- */
.hero { padding: 40px 0 28px; }
.landing .panel { margin-top: 6px; }
@media (min-width: 1000px) {
  .landing .wrap { max-width: 1120px; display: grid; grid-template-columns: 1.05fr .95fr; grid-template-rows: auto 1fr; column-gap: 64px; align-items: start; }
  .landing .hero { padding-top: 72px; grid-column: 1; }
  .landing .formcol { grid-column: 1; }
  .landing .listcol { grid-column: 2; grid-row: 1 / span 2; padding-top: 44px; }
  .landing .listcol .label-row { margin-top: 28px; }
}

/* ---------- personal page ---------- */
.me .hero { padding-bottom: 8px; }
.me .card .row .btn { min-height: 46px; padding: 0 18px; font-size: .96rem; }
.me .ask { margin-top: 8px; }
@media (min-width: 760px) {
  .me .wrap { max-width: 760px; }
  .me .cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- tablet ---------- */
.tablet { font-size: 18px; }
.tablet .bar { height: 76px; padding: 0 32px; }
.tablet .mark { font-size: 1.4rem; }
.tablet .mark svg { width: 32px; height: 32px; }
.tablet .langs button { min-width: 64px; min-height: 52px; font-size: 1rem; }
.tablet .wrap { max-width: none; padding: 0 40px; }
.tablet .hero { padding: 46px 0 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.tablet h1 { font-size: clamp(2.4rem, 4.6vw, 3.4rem); max-width: 15em; }
.tablet .lede { font-size: 1.14rem; }
.tablet .label-row { margin: 40px 0 18px; }
.tablet .label-row .kicker { font-size: .82rem; }
.tablet .cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.tablet .card {
  min-height: 240px; padding: 28px 28px 24px; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tablet .card:active { transform: scale(.985); }
.tablet .card h3 { font-size: 1.72rem; margin: 12px 0 12px; }
.tablet .card p { font-size: 1.02rem; flex: 1; }
.tablet .card .row { justify-content: space-between; margin-top: 22px; }
.tablet .card .open { font-weight: 600; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 32px calc(16px + env(safe-area-inset-bottom));
  background: rgba(243, 241, 235, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.dock p { margin: 0; color: var(--text); font-size: 1.02rem; }
.take {
  display: inline-flex; align-items: center; gap: 14px; min-height: 72px; padding: 0 34px 0 26px; flex: none;
  border: 0; border-radius: 999px; background: var(--ember); color: #fff; cursor: pointer;
  font: 600 1.24rem/1 var(--sans); box-shadow: 0 12px 30px -12px rgba(168, 60, 12, .6);
}
.take:active { transform: scale(.98); }
.take svg { width: 30px; height: 30px; }
.tablet main { padding-bottom: 150px; }
.tablet .card .for { display: none; }

.qr-sheet {
  position: fixed; inset: 0; z-index: 50; background: rgba(21, 23, 28, .94);
  display: grid; place-items: center; padding: 32px; animation: fade .22s ease;
}
.qr-card {
  background: var(--card); border-radius: 26px; padding: 40px 44px 34px; text-align: center;
  max-width: 560px; width: 100%; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
}
.qr-card h2 { font-size: 2.3rem; line-height: 1.1; }
.qr-card p { color: var(--text); margin: 12px auto 0; max-width: 26em; }
.qr-card .qr { width: min(380px, 62vw, 46vh); aspect-ratio: 1; margin: 26px auto 8px; display: block; }
.qr-card .qr svg, .qr-card .qr img { width: 100%; height: 100%; display: block; }
.qr-card .url { font: 600 1.4rem/1 var(--serif); letter-spacing: .06em; margin-top: 10px; }
.qr-close {
  position: absolute; top: 22px; right: 22px; width: 60px; height: 60px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
}

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) { .rise, .qr-sheet { animation: none; } }
