/* ==========================================================================
   Blockwork — stylesheet
   Tokens -> Base -> Layout -> Components -> Sections -> Footer -> Responsive
   ========================================================================== */

:root {
  --bg: #FAFAFA;
  --bg-alt: #E5E5E5;
  --surface: #F5F5F5;
  --text: #171717;
  --text-muted: #737373;
  --border: #D4D4D4;
  --accent: #0A0A0A;
  --accent-hover: #737373;
  --accent-contrast: #FFFFFF;
  --accent-soft: #E5E5E5;
  --gold: #171717;
  --gold-soft: #D4D4D4;
  --shadow: 0 1px 2px rgba(28, 35, 33, 0.06), 0 8px 24px rgba(28, 35, 33, 0.06);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --content-width: 1120px;
  --transition: 180ms ease;
}


:root[data-theme="dark"] {
  --bg: #0A0A0A;
  --bg-alt: #262626;
  --surface: #171717;
  --text: #F5F5F5;
  --text-muted: #8A8A8A;
  --border: #373737;
  --accent: #FAFAFA;
  --accent-hover: #8A8A8A;
  --accent-contrast: #000000;
  --accent-soft: #262626;
  --gold: #F5F5F5;
  --gold-soft: #373737;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--text-muted); max-width: 62ch; }

a { color: inherit; }

/*img, svg { display: block; max-width: 100%; }*/

ul { list-style: none; margin: 0; padding: 0; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.75em 1.25em;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Layout helpers ---------- */

.section {
  padding: 6.5rem 1.5rem;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: left;
}

.hero-inner,
.about-inner,
.contact-inner,
.template-grid,
.blog-grid,
.section-header,
.how-it-works {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ---------- Buttons & pills ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85em 1.6em;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn[hidden] { display: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}
.btn-primary:hover { background: var(--accent); filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); }

.btn-small {
  padding: 0.55em 1.1em;
  font-size: 0.9rem;
}

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3em 0.75em;
  border-radius: 999px;
  margin-bottom: 0.75em;
}
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-gold { background: var(--gold-soft); color: var(--gold); }
.pill-neutral { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 3px;
  font-weight: 500;
}
.text-link:hover { text-decoration-color: var(--accent); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

/* Brand mark is a single inline SVG colored with currentColor, so it
   follows --accent automatically across light, dark, and system theme —
   no separate light/dark image assets or swap logic needed. */
.brand-mark {
  display: inline-flex;
  color: var(--accent);
}
.brand-mark svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: currentColor;
  transition: color var(--transition);
}
.brand-mark-lg svg {
  width: 40px;
  height: 40px;
}

.site-nav ul {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.site-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.theme-switch button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.4em 0.8em;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle-bar {
  width: 16px;
  height: 2px;
  background: var(--text);
  margin: 0 auto;
  transition: transform var(--transition), opacity var(--transition);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
}
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.mobile-nav a {
  display: block;
  padding: 0.6em 0.25em;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
.theme-switch-mobile { justify-content: flex-start; }

.site-header.nav-open .mobile-nav { display: block; }

/* ---------- Hero ---------- */

.hero {
  padding-top: 5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-lead {
  font-size: 1.1rem;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  margin: 1.75rem 0 1.5rem;
  flex-wrap: wrap;
}

.hero-proof {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  height: 340px;
}

.stack-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.stack-card-page {
  width: 78%;
  top: 0;
  left: 0;
  transform: rotate(-3deg);
}
.stack-card-bar {
  width: 40%;
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
  margin-bottom: 0.9rem;
}
.stack-line {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-alt);
  margin-bottom: 0.55rem;
}
.stack-line-lg { width: 90%; }
.stack-line-md { width: 70%; }
.stack-line-sm { width: 45%; }

.stack-card-tags {
  top: 8%;
  right: 0;
  display: flex;
  gap: 0.5rem;
  transform: rotate(4deg);
}
.stack-card-tags .pill { margin-bottom: 0; white-space: nowrap; }

.stack-card-checklist {
  bottom: 0;
  right: 6%;
  width: 62%;
  transform: rotate(2deg);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.check-row:last-child { margin-bottom: 0; }
.check-box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.check-box.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check-row .stack-line { margin-bottom: 0; flex: 1; }

/* How it works */

.how-it-works {
  margin-top: 6rem;
  border-top: 1px solid var(--border);
  padding-top: 3rem;
}
.how-it-works ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.how-it-works li {
  display: flex;
  gap: 1rem;
}
.step-index {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
}
.how-it-works p { margin-bottom: 0; font-size: 0.95rem; }

/* ---------- Templates ---------- */

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.template-card:hover {
  border-color: var(--accent);
}

.template-swatch {
  height: 160px;
  position: relative;
  overflow: hidden;
}
.template-swatch img,
.template-swatch video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.swatch-1 { background: linear-gradient(135deg, var(--accent-soft), var(--accent)); }
.swatch-2 { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); }
.swatch-3 { background: linear-gradient(135deg, var(--bg-alt), var(--accent-soft)); }
.swatch-4 { background: linear-gradient(135deg, var(--accent-soft), var(--gold-soft)); }
.swatch-5 { background: linear-gradient(135deg, var(--gold-soft), var(--accent-soft)); }
.swatch-6 { background: linear-gradient(135deg, var(--bg-alt), var(--gold-soft)); }

.template-body {
  padding: 1.75rem;
}
.template-body p { font-size: 0.95rem; margin-bottom: 1.25rem; }

.template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}

.templates-more {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
  grid-column: 1 / -1;
}

.template-filters {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 auto 2.5rem;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
}

.filter-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5em 1.2em;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* ---------- About ---------- */

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-principles {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.principle-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  margin-bottom: 0.75rem;
}
.principle p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Blog ---------- */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.blog-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.blog-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.blog-card h3 { margin-bottom: 0.5rem; }
.blog-card h3 a {
  text-decoration: none;
  color: var(--text);
}
.blog-card h3 a:hover { color: var(--accent); }
.blog-card p { font-size: 0.95rem; }

/* ---------- Contact ---------- */


.contact-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.contact-card-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}
.contact-card-address {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1.1fr 2fr;
  gap: 3rem;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.footer-brand p {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  margin: 0;
  max-width: 22ch;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}
.footer-col a:hover { color: var(--accent-hover); }
.social-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
}
.footer-bottom p {
  max-width: none;
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 300px; margin-top: 1rem; }
  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: 1fr; }
  .how-it-works ol { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-links { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .site-nav { display: none; }
  .theme-switch { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { padding-left: 1.25rem; padding-right: 1.25rem; }
  .theme-switch-mobile { display: inline-flex; }
  .section { padding: 4rem 1.25rem; }
  .template-grid { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
}

.site-header.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
