/* City Mandate - citymandate.app
   Idea: a Canadian town's civic poster from the railway age, printed today. Brick, slate roofs, cream paper, gold leaf.
   Type: a classic serif for headings (system Georgia / Iowan / Charter), a clean sans for reading. No web fonts,
   no trackers: the site loads nothing from anyone else. */
:root {
  --paper: #f6f0e5;
  --paper-2: #efe6d6;
  --ink: #1d2127;
  --ink-2: #4a505a;
  --line: #ddd2bf;
  --brick: #a5402e;
  --brick-dark: #7f2e20;
  --slate: #24384d;
  --slate-2: #2f4a63;
  --gold: #c9962c;
  --green: #3f6b3a;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 18px 50px -18px rgba(20, 24, 30, .45);
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--brick); text-underline-offset: 3px; }
a:hover { color: var(--brick-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.08; letter-spacing: -.01em; margin: 0; }
.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.eyebrow { font: 700 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--white); padding: 8px 12px; z-index: 10; }

/* ---------- header ---------- */
.top { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--paper); text-decoration: none; font: 700 19px/1 var(--serif); letter-spacing: .02em; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand:hover { color: var(--white); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { color: #e9e1d2; text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, .1); }
.nav a.cta { background: var(--gold); color: #1d1608; font-weight: 700; }
.nav a.cta:hover { background: #ddb04a; }

/* ---------- hero ---------- */
.hero { position: relative; color: var(--paper); background: radial-gradient(1200px 600px at 75% 10%, #3a5876 0%, rgba(36, 56, 77, 0) 60%), linear-gradient(160deg, #1b2a3a 0%, #24384d 55%, #2b2f36 100%); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 140px 0 140px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(44px, 6.2vw, 82px); }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero .lede { font-size: clamp(18px, 1.6vw, 21px); color: #d8d0c1; max-width: 32em; margin: 22px 0 32px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px; font: 700 16px/1 var(--sans); text-decoration: none; border: 2px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.gold { background: var(--gold); color: #1d1608; }
.btn.gold:hover { background: #ddb04a; color: #1d1608; }
.btn.ghost { border-color: rgba(246, 240, 229, .45); color: var(--paper); }
.btn.ghost:hover { border-color: var(--paper); color: var(--white); }
.btn.brick { background: var(--brick); color: var(--white); }
.btn.brick:hover { background: var(--brick-dark); color: var(--white); }
.note { font-size: 14px; color: #b9b2a5; margin-top: 18px; }
.postcards { position: relative; height: min(560px, 44vw); }
.postcards figure { position: absolute; margin: 0; width: 52%; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 6px solid #fbf7ef; background: #fbf7ef; }
.postcards figure img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center 60%; width: 100%; }
.postcards figcaption { font: 600 13px/1.2 var(--serif); color: var(--ink-2); padding: 8px 4px 4px; }
.postcards .p1 { left: 0; top: 8%; transform: rotate(-5deg); }
.postcards .p2 { left: 24%; top: 0; z-index: 2; transform: rotate(1.5deg); }
.postcards .p3 { right: 0; top: 14%; transform: rotate(6deg); }

/* ---------- bands ---------- */
.band { padding: clamp(64px, 9vw, 120px) 0; }
.band h2 { font-size: clamp(34px, 4.4vw, 56px); }
.band .intro { font-size: 19px; color: var(--ink-2); max-width: 40em; margin: 18px 0 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--slate); }
.frame video, .frame img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 70%; }
.caption { font-size: 14px; color: var(--ink-2); margin-top: 12px; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.ticks li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.ticks li::before { content: ""; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; background: var(--brick) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 44px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); margin-bottom: 16px; }
.card .icon svg { width: 26px; height: 26px; stroke: var(--brick); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 23px; margin-bottom: 8px; }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* dark band: people and mayors */
.dark { background: var(--slate); color: var(--paper); }
.dark .intro { color: #cfc7b8; }
.letter { background: #fbf6ea; color: var(--ink); border-radius: 6px; padding: 30px 32px; box-shadow: var(--shadow); font-family: var(--serif); position: relative; transform: rotate(-1deg); }
.letter::before { content: ""; position: absolute; inset: 10px; border: 1px solid #e3d6bc; border-radius: 3px; pointer-events: none; }
.letter .from { font: 700 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--brick); }
.letter p { font-size: 19px; line-height: 1.55; margin: 14px 0; }
.letter .sign { font-style: italic; color: var(--ink-2); }
.letter + .letter { margin-top: 22px; transform: rotate(1.2deg); }
.small { font-size: 13px; color: #a9a296; margin-top: 18px; }

/* towns */
.towns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.town { margin: 0; background: var(--white); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.town img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.town figcaption { padding: 12px 14px 14px; }
.town b { display: block; font: 700 18px/1.2 var(--serif); }
.town span { font-size: 13px; color: var(--ink-2); }

/* eras */
.eras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 40px; border-top: 2px solid var(--ink); }
.era { padding: 22px 22px 0 0; }
.era b { font: 700 clamp(34px, 4vw, 48px)/1 var(--serif); color: var(--brick); display: block; margin-bottom: 10px; }
.era p { margin: 0; color: var(--ink-2); font-size: 15px; padding-right: 10px; }

/* account band */
.account { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px; padding: clamp(28px, 4vw, 44px); }
.games { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.games span { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.badge { width: 84px; height: 84px; }

/* final call */
.final { text-align: center; background: linear-gradient(160deg, #7f2e20, #a5402e 60%, #b9553c); color: var(--white); }
.final h2 { font-size: clamp(36px, 5vw, 64px); }
.final p { color: #f4dcd3; font-size: 19px; margin: 16px auto 30px; max-width: 34em; }
.final .buttons { justify-content: center; }
.final .btn.ghost { border-color: rgba(255, 255, 255, .55); color: var(--white); }

/* ---------- footer ---------- */
footer.site { background: #171b21; color: #a8a196; font-size: 14px; padding: 46px 0; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; align-items: center; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer.site a { color: #d7cfc0; text-decoration: none; }
footer.site a:hover { color: var(--white); text-decoration: underline; }
footer.site .brand { color: var(--paper); font-size: 17px; }

/* ---------- inner pages (legal, support) ---------- */
.page-head { background: linear-gradient(160deg, #1b2a3a, #24384d 60%, #2b2f36); color: var(--paper); padding: 130px 0 56px; }
.page-head h1 { font-size: clamp(38px, 5vw, 60px); }
.page-head .date { color: #c9c1b2; margin: 12px 0 0; }
.doc { width: min(780px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 90px; }
.doc .lead { font-size: 20px; color: var(--ink-2); }
.doc h2 { font-size: 28px; margin: 44px 0 12px; }
.doc li { margin: 8px 0; }
.doc .box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; margin: 26px 0; }
.doc .box ol { margin: 6px 0; padding-left: 22px; }
.doc .contents a { text-decoration: none; }
.doc .contents a:hover { text-decoration: underline; }
.doc details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; margin: 12px 0; }
.doc summary { font-weight: 700; cursor: pointer; }

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .hero .wrap, .two { grid-template-columns: minmax(0, 1fr); }
  .postcards { height: 84vw; max-height: 480px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .towns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .towns .town:nth-child(n+4) { display: none; }
  .eras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .era { padding-bottom: 22px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 36px); }
  .nav a:not(.cta) { display: none; }
  .hero .wrap { padding: 120px 0 80px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .towns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .towns .town:nth-child(n+3) { display: none; }
  .account { grid-template-columns: minmax(0, 1fr); }
  .letter { padding: 26px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
