/* MacBound theme "Grid Index" (option 1a) — Modernist: Archivo, deep navy accent,
   zero radius, strong 2px rules, flush-left. Drop-in replacement for assets/css/main.css. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;800&display=swap');

:root {
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --text: #201e1d;
  --text-secondary: color-mix(in srgb, #201e1d 60%, transparent);
  --border: color-mix(in srgb, #201e1d 20%, transparent);
  --divider: color-mix(in srgb, #201e1d 40%, transparent);
  --accent: #14275c;
  --accent-contrast: #ffffff;
  --max-width: 780px;
  --wide-width: 1100px;
  --radius: 0px; /* Modernist: no rounded corners anywhere */
  font-family: "Archivo", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #1b1a19;
  --surface: #262423;
  --text: #f3f2f2;
  --text-secondary: color-mix(in srgb, #f3f2f2 60%, transparent);
  --border: color-mix(in srgb, #f3f2f2 20%, transparent);
  --divider: color-mix(in srgb, #f3f2f2 35%, transparent);
  --accent: #8da4ee; /* periwinkle for contrast on dark ground */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

img { max-width: 100%; height: auto; border-radius: 0; filter: grayscale(1) contrast(1.08); }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 1.6em 0 0.5em;
}
h1 { font-size: 42px; margin-top: 0; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }

/* Uppercase micro-label — used for section headings on the homepage */
.kicker {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 20px;
}
.kicker--ink { color: var(--text); }

p { margin: 0.9em 0; }

code { background: var(--surface); padding: 0.15em 0.4em; border-radius: 0; font-size: 0.9em; }
pre { background: var(--surface); padding: 1em; border-radius: 0; overflow-x: auto; border-left: 2px solid var(--divider); }
pre code { background: none; padding: 0; }

/* Layout shell */
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.wrap--wide { max-width: var(--wide-width); }

/* Top nav — flat bar, strong 2px bottom rule, uppercase links */
.site-nav {
  border-bottom: 2px solid var(--divider);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.site-nav__inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-nav__brand { font-size: 19px; color: var(--text); }
.site-nav__brand:hover { text-decoration: none; opacity: 0.75; }

/* Wordmark: "Mac" in ink, "Bound" in accent, trailing accent square */
.logo-wordmark { font-weight: 800; letter-spacing: -0.015em; }
.logo-wordmark__mac { color: var(--text); }
.logo-wordmark__bound { color: var(--accent); }
.logo-wordmark__dot {
  display: inline-block;
  width: 0.45em; height: 0.45em;
  border-radius: 0;              /* the dot is now a square */
  background: var(--accent);
  margin-left: 0.15em;
  vertical-align: 0.02em;
}
.logo-wordmark--hero { font-size: 4.2rem; line-height: 1; display: block; margin: 0 0 20px; }
@media (max-width: 640px) { .logo-wordmark--hero { font-size: 2.6rem; } }

.site-nav__links {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-wrap: wrap;
}
.site-nav__links a { color: var(--text); }
.site-nav__links a:hover { color: var(--accent); text-decoration: none; }
.site-nav__links a.is-active { color: var(--accent); }

/* "Useful Apps" dropdown — flat panel, 2px border, no radius */
.nav-dropdown { position: relative; }
.nav-dropdown__trigger {
  background: none; border: none; font: inherit; color: var(--text);
  cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800;
}
.nav-dropdown__trigger:hover { color: var(--accent); }
.nav-dropdown.is-open .nav-dropdown__trigger { color: var(--accent); }
.nav-dropdown__caret { font-size: 0.7em; transition: transform 0.15s ease; }
.nav-dropdown.is-open .nav-dropdown__caret { transform: rotate(180deg); }
.nav-dropdown__menu {
  display: none;
  position: absolute; top: calc(100% + 16px); left: 0; min-width: 260px;
  background: var(--bg);
  border: 2px solid var(--divider);
  border-radius: 0;
  box-shadow: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
  padding: 4px;
  z-index: 20;
}
.nav-dropdown.is-open .nav-dropdown__menu { display: block; }
.nav-dropdown__menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 0; color: var(--text);
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.nav-dropdown__menu a:hover { background: var(--surface); text-decoration: none; }
.nav-dropdown__menu a.is-active { background: var(--surface); }
.nav-dropdown__menu strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.nav-dropdown__menu small { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.nav-dropdown__accent { width: 9px; height: 9px; border-radius: 0; flex-shrink: 0; background: var(--accent); }

/* Theme toggle button */
.theme-toggle {
  background: var(--text); color: var(--bg);
  border: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 8px 14px;
}
.theme-toggle:hover { background: var(--accent); color: var(--accent-contrast); }
[data-theme="dark"] .theme-toggle:hover { color: #1b1a19; }

/* Section accent bar — a strong rule, not a color strip */
.section-bar { height: 2px; background: var(--accent); }

.section-badge {
  display: inline-block;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-contrast);
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 0;
  margin-bottom: 14px;
}
.breadcrumb { font-size: 13px; color: var(--text-secondary); margin: 22px 0 6px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.breadcrumb a { color: var(--text-secondary); }

/* Homepage hero — flush left, poster scale */
.hero { padding: 72px 0 56px; text-align: left; }
.hero h1 { font-size: clamp(44px, 8vw, 92px); line-height: 0.98; letter-spacing: -0.025em; margin: 0 0 24px; max-width: 980px; }
.hero p { color: var(--text-secondary); font-size: 19px; max-width: 560px; margin: 0; }

/* Strong horizontal rule between homepage sections */
.hr, hr.hr { height: 2px; border: 0; margin: 0; background: var(--divider); }

/* Reference — equal-width cells with 2px left rules */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 24px 0 40px;
}
.ref-cell {
  display: block;
  border-left: 2px solid var(--divider);
  padding: 4px 20px 28px 16px;
  color: var(--text);
}
.ref-cell:hover { text-decoration: none; }
.ref-cell:hover h3 { color: var(--accent); }
.ref-cell__no { font-weight: 800; font-size: 13px; color: var(--accent); margin-bottom: 40px; }
.ref-cell h3 { font-size: 17px; margin: 0 0 8px; line-height: 1.15; }
.ref-cell p { font-size: 13px; line-height: 1.5; margin: 0; color: var(--text-secondary); }

/* Guides — numbered index rows */
.guide-index { display: flex; flex-direction: column; margin: 24px 0 56px; }
.guide-row {
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  gap: 16px; align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.guide-row:hover { text-decoration: none; color: var(--accent); }
.guide-row__no { font-size: 13px; font-weight: 800; color: color-mix(in srgb, var(--text) 45%, transparent); }
.guide-row__title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.guide-row__arrow { font-weight: 800; color: var(--accent); }

/* Poster banner — the one place the accent runs as a field */
.poster { background: #14275c; color: #ffffff; padding: 64px 40px; margin: 0 -24px; }
.poster__kicker { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; opacity: 0.8; }
.poster__title { font-weight: 800; font-size: clamp(32px, 5vw, 52px); line-height: 1.02; letter-spacing: -0.02em; max-width: 800px; }

/* Legacy card grid (still used on section pages) — flat surface cells */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 32px 0 64px; }
.card { display: block; border: none; border-radius: 0; padding: 28px 24px 32px; background: var(--surface); transition: none; }
.card:hover { text-decoration: none; transform: none; box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px; }
.card__accent { width: 32px; height: 4px; border-radius: 0; margin-bottom: 16px; background: var(--accent); }
.card h3 { margin: 0 0 4px; color: var(--text); font-size: 19px; }
.card p { color: var(--text-secondary); margin: 0.4em 0 0; font-size: 14px; }

/* Post / article list */
.post-list-item { padding: 22px 0; border-bottom: 1px solid var(--border); }
.post-list-item h3 { margin: 0 0 4px; font-size: 20px; }
.post-list-item h3 a { color: var(--text); }
.post-list-item h3 a:hover { color: var(--accent); text-decoration: none; }
.post-list-item .meta { color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.post-list-item p { color: var(--text-secondary); font-size: 15px; }

.article-meta { color: var(--text-secondary); font-size: 13px; margin-bottom: 2em; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* Reference tables */
.ref-table-wrap { overflow-x: auto; margin: 1.5em 0; }
table.ref-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ref-table th, table.ref-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.ref-table th {
  color: var(--text); font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 2px solid var(--divider);
}
table.ref-table td.mono { font-variant-numeric: tabular-nums; }
table.ref-table kbd, .kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 2px 7px; font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
table.ref-table tr.is-hidden { display: none; }
.ref-table .notes { color: var(--text-secondary); font-size: 0.88em; }

/* Filter toolbar */
.ref-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 1.5em 0; }
.ref-toolbar input[type="search"] {
  flex: 1; min-width: 200px; padding: 10px 14px;
  border: 2px solid var(--divider); border-radius: 0;
  font-size: 15px; font-family: inherit; background: var(--bg); color: var(--text);
}
.ref-toolbar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn {
  border: 2px solid var(--divider); background: transparent; border-radius: 0;
  padding: 9px 16px; font-size: 13px; font-weight: 800; font-family: inherit;
  cursor: pointer; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.is-active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
[data-theme="dark"] .btn.is-active { color: #1b1a19; }

.copy-btn { border: none; background: none; cursor: pointer; color: var(--text-secondary); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px; border-radius: 0; font-family: inherit; }
.copy-btn:hover { background: var(--surface); color: var(--text); }
.copy-btn.is-copied { color: var(--accent); }

.fav-btn { border: none; background: none; cursor: pointer; font-size: 1.05rem; color: var(--border); padding: 2px 6px; line-height: 1; }
.fav-btn.is-fav { color: var(--accent); }

.empty-state { color: var(--text-secondary); padding: 40px 0; text-align: left; display: none; }

/* Gesture cards */
.gesture-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 1.5em 0; }
.gesture-card { border-left: 2px solid var(--divider); border-radius: 0; padding: 4px 18px 18px 16px; background: transparent; }
.gesture-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gesture-card h4 { margin: 0; font-size: 16px; }
.finger-pill { font-size: 11px; font-weight: 800; background: transparent; border: 1px solid var(--border); padding: 2px 9px; border-radius: 0; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.gesture-card .motion { font-style: normal; color: var(--text-secondary); font-size: 13px; margin: 0 0 8px; }
.gesture-card .win-eq { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }

/* Tip cards (first-week page) */
.tip-card { border: none; border-left: 2px solid var(--divider); border-radius: 0; padding: 4px 22px 20px 16px; margin: 20px 0; scroll-margin-top: 90px; }
.tip-card .day-label { color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

/* Footer */
.site-footer { border-top: 2px solid var(--divider); margin-top: 80px; padding: 28px 0 60px; color: var(--text); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent); text-decoration: none; }
.site-footer__links { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; }

/* App hero — flat navy field instead of a gradient */
.app-hero { background: #14275c; color: #ffffff; padding: 56px 0 48px; margin: -20px 0 0; }
.app-hero__inner { max-width: var(--wide-width); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.app-hero__icon { width: 96px; height: 96px; border-radius: 0; box-shadow: 0 12px 32px rgba(0,0,0,0.35); flex-shrink: 0; filter: grayscale(1) contrast(1.08); }
.app-hero__text h1 { margin: 0 0 4px; font-size: 32px; color: #ffffff; }
.app-hero__text p { margin: 0 0 18px; color: rgba(255,255,255,0.75); font-size: 17px; }
.app-hero__badge img { height: 44px; width: auto; border-radius: 0; display: block; filter: none; }

.app-screens { display: flex; gap: 18px; overflow-x: auto; padding: 28px 24px 8px; margin: 0 auto; max-width: var(--wide-width); scroll-snap-type: x proximity; }
.app-screens img { height: 320px; width: auto; border-radius: 0; box-shadow: 0 8px 28px rgba(0,0,0,0.18); flex-shrink: 0; scroll-snap-align: start; }
@media (max-width: 640px) {
  .app-hero { padding: 40px 0 32px; }
  .app-hero__inner { gap: 18px; }
  .app-hero__icon { width: 72px; height: 72px; }
  .app-hero__text h1 { font-size: 24px; }
  .app-screens img { height: 220px; }
}

/* App feature list */
.app-features { list-style: none; padding: 0; margin: 1.2em 0; display: grid; gap: 10px; }
.app-features li { padding-left: 26px; position: relative; }
.app-features li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* Print */
@media print {
  .site-nav, .site-footer, .ref-toolbar, .theme-toggle, .no-print { display: none !important; }
  body { font-size: 12pt; }
  table.ref-table tr.is-hidden { display: none; }
  a { color: var(--text) !important; text-decoration: none !important; }
}

@media (max-width: 640px) {
  .hero { padding: 40px 0 32px; }
  h1 { font-size: 30px; }
  .guide-row { grid-template-columns: 40px 1fr 20px; }
  .poster { padding: 48px 24px; }
}
