/* The Year Board — Annual Saving.
   A hanging wall calendar on a cocoa plaster wall.
   Not a cutting-table tray, not a survey plat, not a typographic spine. */

:root {
  --plaster: #4a2f28;
  --plaster-deep: #3a241f;
  --plaster-lift: #5a3a32;
  --enamel: #fff8ee;
  --enamel-soft: #f4e6d3;
  --ink: #1a1410;
  --quiet: #5c4e44;
  --faint: #7a6a5e;
  --tomato: #c4391d;
  --tomato-deep: #9b2c15;
  --brass: #b08d3e;
  --brass-soft: #e6d5a6;
  --rail: #161210;
  --rule: #d9cbb8;
  --focus: #c4391d;
  --shadow: 0 18px 40px rgba(16, 10, 8, 0.35);
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --body: "Manrope", "Trebuchet MS", "Segoe UI", sans-serif;
  --mono: "Azeret Mono", "ui-monospace", "Cascadia Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body.plaster {
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 220, 190, 0.08), transparent 42%),
    radial-gradient(ellipse at 88% 16%, rgba(0, 0, 0, 0.18), transparent 36%),
    repeating-linear-gradient(118deg, transparent 0 17px, rgba(255, 255, 255, 0.015) 17px 18px),
    var(--plaster);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tomato-deep); text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-rail {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  background: var(--enamel);
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  z-index: 40;
  font-family: var(--mono);
  font-size: 0.8rem;
  text-decoration: none;
  border: 2px solid var(--rail);
}
.skip-rail:focus { top: 0.6rem; }

/* Thin black metal hanging rail — tabs hang from rings, not a filled header bar */
.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  background: transparent;
  padding: 0 1rem;
}
.rail-bar {
  height: 10px;
  background:
    linear-gradient(180deg, #3a332e 0%, var(--rail) 40%, #0c0a08 100%);
  border-radius: 0 0 2px 2px;
  box-shadow: 0 2px 0 #000, 0 6px 14px rgba(0, 0, 0, 0.28);
}
.hanger {
  width: min(76rem, 100%);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 0 0.4rem;
  position: relative;
  top: -10px;
}
.dateblock {
  flex: 0 0 auto;
  width: 6.4rem;
  background: var(--enamel);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  border: 2px solid var(--rail);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  position: relative;
  padding: 0.85rem 0.4rem 0.65rem;
}
.dateblock::before,
.tabclip::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 8px;
  height: 18px;
  margin-left: -4px;
  background:
    radial-gradient(circle at 50% 5px, #cfc8bf 0 3px, transparent 4px),
    linear-gradient(90deg, #2a2520, #111);
  border-radius: 3px;
}
.dateblock-month {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tomato);
  font-weight: 600;
}
.dateblock-year {
  display: block;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: 2.05rem;
  line-height: 0.9;
  font-weight: 600;
  color: var(--ink);
}
.dateblock-name {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
}
.rings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
  padding-top: 0.85rem;
  flex: 1 1 auto;
}
.tabclip {
  position: relative;
  display: inline-block;
  background: var(--enamel);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.05rem;
  padding: 0.7rem 0.95rem 0.55rem;
  border: 2px solid var(--rail);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.16);
  min-width: 6.2rem;
  text-align: center;
}
.tabclip:hover { background: var(--enamel-soft); color: var(--tomato-deep); }
.tabclip[aria-current="page"] {
  background: #fff;
  box-shadow: 0 7px 0 var(--tomato);
}

/* The hanging enamel board */
.enamel {
  width: min(76rem, calc(100% - 2rem));
  margin: 1.15rem auto 2.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 8%),
    var(--enamel);
  color: var(--ink);
  border: 2px solid var(--rail);
  box-shadow: var(--shadow);
  position: relative;
  padding: 2.1rem 2rem 2.4rem;
  min-height: 70vh;
}
.enamel::before,
.enamel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0e2b0, var(--brass) 55%, #6a541c);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  z-index: 2;
}
.enamel::before { top: 12px; left: 12px; }
.enamel::after { top: 12px; right: 12px; }
.brass-corners {
  pointer-events: none;
}
.brass-corners span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0e2b0, var(--brass) 55%, #6a541c);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  z-index: 2;
}
.brass-corners .sw { bottom: 12px; left: 12px; }
.brass-corners .se { bottom: 12px; right: 12px; }

.crumbtrail {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--quiet);
  margin: 0 0 1.1rem;
}
.crumbtrail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.4rem; }
.crumbtrail li:not(:last-child)::after { content: " /"; color: var(--faint); }
.crumbtrail a { color: var(--quiet); text-decoration: none; }
.crumbtrail a:hover { color: var(--tomato-deep); text-decoration: underline; }

.standline {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
}
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tomato);
  margin: 0 0 0.55rem;
  font-weight: 600;
}
.leadline {
  font-size: 1.18rem;
  color: var(--quiet);
  max-width: 42rem;
  margin: 0 0 1.4rem;
}
.inkline { margin: 0 0 1rem; }
.quietline { color: var(--quiet); margin: 0 0 0.7rem; }
.hintline {
  font-size: 0.95rem;
  color: var(--quiet);
  border-left: 3px solid var(--brass);
  padding: 0.2rem 0 0.2rem 0.85rem;
  margin: 1rem 0 0;
}
.fieldrow .hintline {
  border-left: 0;
  padding: 0;
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--faint);
}
.fineprint {
  font-size: 0.9rem;
  color: var(--quiet);
  margin: 1.2rem 0 0;
}

/* Home year grid — twelve hanging month pockets */
.yeargrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 1.6rem 0 0.4rem;
}
.monthhang {
  background: #fffdf8;
  border: 1px solid var(--rule);
  padding: 0.9rem 0.9rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 9.5rem;
  box-shadow: 0 1px 0 rgba(26, 20, 16, 0.04);
  position: relative;
}
.monthhang:hover {
  border-color: var(--tomato);
  box-shadow: 0 8px 0 rgba(196, 57, 29, 0.12);
  color: inherit;
}
.monthhang-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tomato);
  font-weight: 600;
}
.monthhang-title {
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.15;
  margin: 0.35rem 0 0.4rem;
}
.monthhang p { margin: 0; color: var(--quiet); font-size: 0.95rem; flex: 1; }

.board-hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 0.6rem;
}
.hero-art { margin: 0; }
.hero-art figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  margin-top: 0.4rem;
}

.tool-strip, .guide-strip {
  margin: 2.2rem 0 0;
}
.tool-strip h2, .guide-strip h2, .almanac h2, .tacked h2, .drawer h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 550;
  margin: 0 0 0.8rem;
}
.linkrow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.linktile {
  border-top: 3px solid var(--rail);
  padding: 0.7rem 0 0.2rem;
  text-decoration: none;
  color: inherit;
}
.linktile:hover { color: var(--tomato-deep); }
.linktile strong {
  display: block;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 550;
}
.linktile span { color: var(--quiet); font-size: 0.95rem; }

/* Almanac chassis — two newspaper-like columns for guides */
.almanac {
  column-count: 2;
  column-gap: 2.6rem;
  column-rule: 1px solid var(--rule);
  column-fill: balance;
}
.almanac p,
.almanac h2,
.almanac h3,
.almanac ul,
.almanac ol {
  break-inside: avoid;
}
.almanac-head {
  column-span: all;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 3px double var(--rail);
}
.almanac h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}
.almanac h2 {
  break-after: avoid;
  margin: 1.3rem 0 0.55rem;
}
.almanac h3 {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.1rem 0 0.4rem;
  color: var(--tomato-deep);
  break-after: avoid;
}
.almanac p { margin: 0 0 0.9rem; }
.almanac ul, .almanac ol { margin: 0 0 1rem; padding-left: 1.15rem; }
.almanac li { margin: 0 0 0.35rem; }
.almanac .faqblock, .almanac .next-clip {
  column-span: all;
  margin-top: 1.8rem;
  padding-top: 1rem;
  border-top: 2px solid var(--rail);
  break-inside: avoid;
}

/* Tools — a deposit-slip form on the enamel */
.slip {
  max-width: 44rem;
}
.slip h1 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.1;
  margin: 0 0 0.7rem;
}
.slipform {
  background:
    linear-gradient(180deg, rgba(196, 57, 29, 0.07), rgba(196, 57, 29, 0.07) 10px, transparent 10px),
    #fffdf8;
  border: 1px solid var(--rail);
  box-shadow: inset 0 0 0 3px var(--enamel-soft);
  padding: 1.25rem 1.15rem 1.2rem;
  margin: 1.1rem 0;
}
.slipform fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}
.slipform legend {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tomato-deep);
  padding: 0;
  margin: 0 0 0.45rem;
  font-weight: 600;
}
.fieldrow {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.85rem;
}
.fieldrow label { font-weight: 600; }
.fieldrow input,
.fieldrow select,
.fieldrow textarea {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-bottom: 2px solid var(--rail);
  background: transparent;
  color: var(--ink);
  border-radius: 0;
  width: 100%;
  max-width: 24rem;
}
.fieldrow textarea { max-width: 100%; min-height: 6rem; border: 2px solid var(--rail); padding: 0.55rem; }
.fieldrow input:focus,
.fieldrow select:focus,
.fieldrow textarea:focus {
  outline: none;
  border-bottom-color: var(--tomato);
  background: rgba(196, 57, 29, 0.04);
}
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}
.choice-row label {
  font-weight: 500;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.repeat-block { margin: 0 0 0.8rem; }
.repeat-item {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr auto;
  gap: 0.5rem;
  align-items: end;
  margin: 0 0 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--rule);
}
.repeat-item.fund-row { grid-template-columns: 1.2fr 0.8fr 0.8fr 0.7fr auto; }
.repeat-item.bucket-row { grid-template-columns: 1.4fr 0.8fr auto; }
.repeat-item label { font-size: 0.82rem; font-weight: 600; color: var(--quiet); display: flex; flex-direction: column; gap: 0.2rem; }
.repeat-item input, .repeat-item select {
  font: inherit;
  padding: 0.35rem 0.4rem;
  border: 0;
  border-bottom: 2px solid var(--rail);
  background: transparent;
  width: 100%;
}
.press-tab,
.ghost-tab {
  font-family: var(--display);
  font-size: 1.05rem;
  padding: 0.55rem 1rem 0.45rem;
  border: 2px solid var(--rail);
  background: var(--tomato);
  color: #fffaf4;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--rail);
}
.press-tab:hover { background: var(--tomato-deep); }
.ghost-tab {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
}
.ghost-tab:hover { background: var(--enamel-soft); }
.row-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.outbox {
  margin: 1.1rem 0 0;
  padding: 1rem 1.05rem;
  border: 2px solid var(--rail);
  background: #fffdf8;
}
.outbox:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.tally-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.45rem 0;
  align-items: baseline;
}
.figurebox {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tally-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 0.2rem;
  font-size: 0.95rem;
}
.tally-table caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  color: var(--quiet);
}
.tally-table th, .tally-table td {
  text-align: left;
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.tally-table th { font-weight: 650; }

/* Index drawer */
.drawer h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  margin: 0 0 0.7rem;
}
.cardlist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 1.4rem;
  margin: 1.2rem 0 0;
}
.cardlist a {
  text-decoration: none;
  color: inherit;
  border-left: 4px solid var(--brass);
  padding: 0.35rem 0 0.35rem 0.8rem;
  display: block;
}
.cardlist a:hover { border-left-color: var(--tomato); }
.cardlist strong { display: block; font-family: var(--display); font-size: 1.25rem; }
.cardlist span { color: var(--quiet); }

/* Tacked notice — legal / about */
.tacked {
  max-width: 42rem;
  background: #fffdf8;
  border: 1px solid var(--rule);
  padding: 1.6rem 1.6rem 1.8rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  position: relative;
}
.tacked::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0e2b0, var(--brass) 58%, #5a4718);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.tacked h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin: 0.4rem 0 0.8rem;
}
.tacked h2 { margin: 1.3rem 0 0.5rem; font-size: 1.35rem; }

/* 404 tear-off calendar page */
.tearoff {
  max-width: 28rem;
  margin: 1rem auto 2rem;
  background: #fffdf8;
  border: 2px solid var(--rail);
  text-align: center;
  padding: 0 1.4rem 2rem;
  box-shadow: var(--shadow);
  position: relative;
}
.tearoff-head {
  background: var(--tomato);
  color: #fffaf4;
  margin: 0 -1.4rem;
  padding: 0.7rem 1rem 0.55rem;
  font-family: var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8rem;
}
.tearoff-num {
  font-family: var(--display);
  font-size: 7.5rem;
  line-height: 0.85;
  margin: 1.1rem 0 0.3rem;
  color: var(--ink);
}
.tearoff h1 {
  font-family: var(--display);
  font-size: 2rem;
  margin: 0 0 0.6rem;
}

.faqblock details {
  border-bottom: 1px solid var(--rule);
  padding: 0.55rem 0;
}
.faqblock summary {
  cursor: pointer;
  font-weight: 650;
  font-family: var(--display);
  font-size: 1.15rem;
}
.faqblock details p { margin: 0.45rem 0 0.6rem; }
.next-clip {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--display);
  font-size: 1.25rem;
}

/* Footer sits on the plaster, not on the enamel */
.footboard {
  width: min(76rem, calc(100% - 2rem));
  margin: 0 auto 2.2rem;
  color: #f3e6d8;
  padding: 0.4rem 0.2rem 1.4rem;
}
.footboard a { color: #f0c9a0; }
.footboard a:hover { color: #fff; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  list-style: none;
  margin: 0 0 0.7rem;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.copyright-line {
  font-family: var(--display);
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}
.foot-note {
  margin: 0;
  color: #f3e6d8;
  font-size: 0.88rem;
  max-width: 46rem;
}

@media (max-width: 980px) {
  .yeargrid { grid-template-columns: repeat(3, 1fr); }
  .board-hero { grid-template-columns: 1fr; }
  .linkrow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body.plaster { font-size: 1.02rem; }
  .hanger { flex-direction: column; gap: 0.4rem; }
  .dateblock { width: 5.6rem; }
  .rings { padding-top: 0.35rem; }
  .enamel { width: calc(100% - 1.2rem); padding: 1.5rem 1rem 1.8rem; margin-top: 0.8rem; }
  .yeargrid { grid-template-columns: repeat(2, 1fr); }
  .cardlist, .linkrow { grid-template-columns: 1fr; }
  .repeat-item, .repeat-item.fund-row, .repeat-item.bucket-row { grid-template-columns: 1fr; }
  .tally-row { flex-direction: column; gap: 0.15rem; }
  .figurebox { font-size: 1.6rem; }
  .almanac { column-width: auto; column-count: 1; }
  .standline { font-size: 1.85rem; }
}
@media (max-width: 420px) {
  .yeargrid { grid-template-columns: 1fr; }
  .tabclip { min-width: 0; padding: 0.55rem 0.7rem 0.4rem; font-size: 0.98rem; }
  .monthhang { min-height: 0; }
  .tearoff-num { font-size: 5.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .rail, .footboard, .skip-rail, .press-tab, .ghost-tab { display: none; }
  body.plaster { background: #fff; }
  .enamel { box-shadow: none; border-color: #000; width: 100%; margin: 0; }
}
