:root {
  --ink: #101820;
  --paper: #f4eddf;
  --paper-deep: #e7dcc7;
  --signal: #ff5638;
  --blue: #2c5ccd;
  --mint: #9bc5ad;
  --line: rgba(16, 24, 32, 0.2);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 24, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 32, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  font-family: "DM Sans", sans-serif;
}

a { color: inherit; }

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(22px, 5vw, 72px);
  color: var(--paper);
  background: var(--ink);
  border-bottom: 5px solid var(--signal);
}

.note-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.note-brand img { border-radius: 50%; }

.note-header > a:last-child {
  color: var(--paper);
  text-decoration-color: var(--signal);
  text-underline-offset: 5px;
}

.note-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.note-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: clamp(36px, 7vw, 96px);
  padding: clamp(58px, 9vw, 118px) 0 48px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--signal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(3.8rem, 9vw, 8.5rem);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: -0.045em;
}

.note-deck {
  margin: 0;
  padding: 26px 0 4px 26px;
  border-left: 2px solid var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: rgba(16, 24, 32, 0.7);
  font-family: monospace;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-visual {
  margin: 42px 0 72px;
  padding: clamp(12px, 2vw, 24px);
  background: var(--ink);
  box-shadow: 18px 18px 0 var(--signal);
}

.note-visual img { display: block; width: 100%; height: auto; }

.note-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: clamp(48px, 8vw, 110px);
  padding: 20px 0 100px;
}

.note-copy h2 {
  margin: 0 0 22px;
  font-family: "Instrument Serif", serif;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  font-weight: 400;
  line-height: 0.95;
}

.note-copy h3 {
  margin: 52px 0 14px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.note-copy p, .note-copy li { font-size: 1.07rem; line-height: 1.72; }
.note-copy ul { padding-left: 1.2em; }

.answer-strip {
  margin: 34px 0;
  padding: 26px;
  background: var(--signal);
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
}

.source-ledger {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 26px;
  color: var(--paper);
  background: var(--ink);
}

.source-ledger h2 {
  margin: 0 0 8px;
  font-family: "Instrument Serif", serif;
  font-size: 2.2rem;
  font-weight: 400;
}

.source-ledger > p { color: rgba(244, 237, 223, 0.7); line-height: 1.55; }
.source-ledger ol { margin: 28px 0 0; padding-left: 22px; }
.source-ledger li { margin-bottom: 22px; padding-left: 5px; }
.source-ledger a { color: var(--paper); text-decoration-color: var(--signal); text-underline-offset: 4px; }
.source-ledger small { display: block; margin-top: 6px; color: var(--mint); line-height: 1.4; }

.next-note {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 46px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.note-footer { padding: 28px; color: var(--paper); background: var(--ink); text-align: center; }

@media (max-width: 760px) {
  .note-header { align-items: flex-start; }
  .note-brand span { display: none; }
  .note-hero, .note-grid { grid-template-columns: 1fr; }
  .note-hero { padding-top: 54px; }
  h1 { font-size: clamp(3.4rem, 18vw, 6rem); }
  .note-deck { padding-left: 18px; }
  .note-visual { margin-right: 10px; box-shadow: 10px 10px 0 var(--signal); }
  .source-ledger { position: static; }
}

/* v1.04 field-note email ask */
.note-signup{margin:48px auto 0;max-width:720px;padding:26px 24px;border:1px solid rgba(23,23,20,.14);border-radius:14px;background:rgba(255,255,255,.55)}
.note-signup h2{margin:0 0 6px;font-size:1.35rem}
.note-signup p{margin:0 0 14px;color:#4a4a44}
.note-signup__row{display:flex;gap:10px;flex-wrap:wrap}
.note-signup__row input{flex:1 1 240px;padding:12px 14px;border:1px solid rgba(23,23,20,.25);border-radius:10px;font:inherit;background:#fff}
.note-signup__row button{padding:12px 18px;border:0;border-radius:10px;background:var(--red,#b72c20);color:#fff;font:600 14px/1 "DM Sans",system-ui,sans-serif;cursor:pointer}
.note-signup__hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.note-signup__consent{display:flex;gap:10px;align-items:flex-start;margin:12px 0 0;font-size:.9rem;color:#4a4a44}
.note-signup__status{margin:10px 0 0;font-size:.9rem;color:#171714}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* v1.08: the whole note card opens its note, not only the title link. */
.note-card { position: relative; }
.note-card h2 a::after { content: ""; position: absolute; inset: 0; }

/* v1.10: click-to-load YouTube study clips */
.yt-embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt-embed > a, .yt-embed > iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }
.yt-embed > a img { width: 100%; height: 100%; object-fit: cover; }
.yt-embed__play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: rgba(16, 24, 32, 0.82); box-shadow: 0 0 0 3px var(--paper); transition: background .15s ease, transform .15s ease; }
.yt-embed__play::after { content: ""; position: absolute; left: 34px; top: 26px; border-style: solid; border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent var(--paper); }
.yt-embed > a:hover .yt-embed__play, .yt-embed > a:focus-visible .yt-embed__play { background: var(--signal); transform: scale(1.06); }
.yt-embed > a:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
@media (max-width: 480px) { .yt-embed__play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .yt-embed__play::after { left: 26px; top: 20px; border-width: 12px 0 12px 20px; } }

/* v1.14: YouTube subscribe (owner 10-11) */
.yt-ico{flex:none}
.note-yt{margin-left:auto;display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:999px;background:#b72c20;color:#fff !important;text-decoration:none !important;font:700 12px/1 "DM Sans",system-ui,sans-serif;letter-spacing:.07em;text-transform:uppercase;--yt-tri:#b72c20}
.note-yt:hover{background:#7d1b15;--yt-tri:#7d1b15}
.note-yt .yt-ico{color:#fff}
.site-header nav{display:flex;align-items:center;gap:18px}
.yt-sub{display:flex;align-items:center;gap:18px;justify-content:space-between;max-width:1180px;margin:22px auto 30px;padding:18px 22px;border-radius:14px;background:#171714;color:#f3efe4}
.yt-sub p{margin:0;line-height:1.5}
.yt-sub strong{color:#fff}
.yt-sub__btn{flex:none;display:inline-flex;align-items:center;gap:9px;padding:13px 20px;border-radius:10px;background:#b72c20;color:#fff;text-decoration:none;font:700 14px/1 "DM Sans",system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;--yt-tri:#b72c20}
.yt-sub__btn:hover{background:#d23a2c;--yt-tri:#d23a2c}
.yt-sub__btn .yt-ico{color:#fff}
@media (max-width:660px){.yt-sub{flex-direction:column;align-items:stretch}.yt-sub__btn{justify-content:center}.note-yt span{display:none}.note-yt{padding:9px 11px}}

/* v1.14: Field Notes index (was unstyled) */
.fn-index main{width:min(1180px,calc(100% - 36px));margin:0 auto;padding-bottom:64px}
.fn-index .hero{padding:clamp(40px,7vw,84px) 0 18px}
.fn-index .hero .eyebrow{margin:0 0 14px}
.fn-index .hero h1{margin:0 0 16px}
.fn-index .dek{max-width:40rem;margin:0;font-size:1.15rem;line-height:1.6}
.fn-index .note-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px;margin-top:30px}
.fn-index .note-card{background:rgba(255,255,255,.6);border:1px solid var(--line);border-top:4px solid var(--ink);padding:20px 22px;transition:transform .15s,border-color .15s}
.fn-index .note-card:hover{transform:translateY(-2px);border-top-color:var(--signal)}
.fn-index .note-card .kicker{margin:0 0 10px;color:var(--signal);font-size:.72rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase}
.fn-index .note-card h2{margin:0 0 10px;font-family:"Instrument Serif",serif;font-weight:400;font-size:1.75rem;line-height:1.05}
.fn-index .note-card h2 a{text-decoration:none}
.fn-index .note-card h2 a:hover{text-decoration:underline;text-decoration-color:var(--signal)}
.fn-index .note-card p{margin:0;line-height:1.55}

/* v1.19: comfortable touch targets on phones (DEEP UX review) */
@media (max-width:660px){.note-yt{min-height:44px;min-width:44px;justify-content:center}.note-header > a:last-child{display:inline-flex;align-items:center;min-height:44px;padding:0 4px}}

/* v1.32.1: site menu in the note header */
.note-nav { display: flex; gap: 20px; align-items: center; }
.note-nav a { color: var(--paper); text-decoration-color: var(--signal); text-underline-offset: 5px; }
.note-nav a[aria-current="page"] { text-decoration-thickness: 3px; }
@media (max-width:660px){.note-header{flex-wrap:wrap}.note-nav{order:3;width:100%;gap:22px}.note-nav a{display:inline-flex;align-items:center;min-height:44px}}

/* v1.73: the story link under a grade page's next-grade nav */
.next-also{margin:-6px 0 0;font:14px/1.5 'DM Sans',system-ui,sans-serif}
.next-also a{color:inherit;opacity:.8}

/* v1.73: the kanji series as one block on the notes list */
.note-series{margin:0 0 34px}
.note-series__title{margin:0 0 6px}
.note-series__line{margin:0 0 16px;font-weight:700}
.note-clip{margin:10px 0 0;font-size:.78rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;opacity:.75}
