:root {
  --bg: #f7f1e8;
  --card: #fffaf2;
  --text: #2b2118;
  --muted: #6b5b4b;
  --primary: #c2562f;
  --primary-hover: #a64623;
  --accent: #e0a03a;
  --border: #e3d6c5;
  --border-strong: #cdbba4;
  --tray-outer: #35271c;
  --tray-well: #251b13;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--text);
  font-weight: 700;
}

h1 {
  font-size: 36px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 28px;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 22px;
}

p {
  margin: 0 0 16px;
  max-width: 70ch;
}

p:last-child {
  margin-bottom: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.brand-mark {
  border-radius: 6px;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}

.site-nav a:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-outline {
  background: var(--card);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-like[data-gf-liked],
.btn-like[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.like-heart {
  font-size: 16px;
}

.engage-count {
  font-variant-numeric: tabular-nums;
}

/* Hero & Tool */
.hero-studio {
  padding: 24px 0 48px;
}

.hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.hero-lead {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.engage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.engage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.share-status {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.engage-privacy {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Page sections */
.page-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 32px;
}

.section-intro {
  color: var(--muted);
  margin-top: 8px;
  font-size: 16px;
}

/* Examples: alternating image + text */
.examples-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.example-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}

.example-row.is-reverse .example-media {
  order: 2;
}

.example-media {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.example-media img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.example-media figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 8px;
}

.example-copy h3 {
  margin-bottom: 12px;
}

.detail-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.detail-list li {
  margin-bottom: 8px;
}

/* Steps: numbered horizontal flow without cards */
.steps-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.step-item {
  border-top: 2px solid var(--border-strong);
  padding-top: 16px;
}

.step-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 8px;
}

.step-item h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step-item p {
  font-size: 14px;
  color: var(--muted);
}

/* Specs: asymmetric split + 2x2 matrix */
.specs-split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 32px;
  align-items: start;
}

.manifesto-lead {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 12px 0;
}

.formats-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--card);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--muted);
}

.specs-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.spec-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.spec-cell h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.spec-cell p {
  font-size: 14px;
  color: var(--muted);
}

/* Solving Guide: editorial vertical timeline */
.guide-wrap {
  max-width: 820px;
}

.guide-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-left: 2px solid var(--border-strong);
  padding-left: 24px;
}

.timeline-step {
  position: relative;
}

.timeline-marker {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.timeline-body h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.timeline-body p {
  color: var(--muted);
}

/* FAQ: flat two-column definition list */
.faq-index {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}

.faq-entry {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.faq-entry dt {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-entry dd {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* Comments */
.comments-wrap {
  max-width: 760px;
}

.comments-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

.comment-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.reply-banner {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}

.comment-msg {
  font-size: 14px;
  color: var(--muted);
}

.comment-list[data-gf-empty]::before {
  content: "No notes yet — share your fastest 4x4 time, favorite grid size, or which photo made the trickiest puzzle.";
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 16px 0;
}

.comment-list[data-gf-off]::before {
  content: "Comments are currently closed.";
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.comment-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.comment-item[data-gf-owner] {
  border-color: var(--accent);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.owner-badge {
  font-size: 12px;
  font-weight: 600;
  background: var(--accent);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 6px;
}

.comment-time {
  color: var(--muted);
  font-size: 12px;
}

.comment-text {
  margin: 0 0 8px;
  font-size: 16px;
}

.reply-target {
  color: var(--primary);
  font-weight: 600;
  margin-right: 6px;
}

.link-btn {
  background: none;
  border: none;
  padding: 4px 0;
  min-height: 32px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.comment-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

/* Doc / Legal pages */
.page-doc {
  padding: 48px 0 64px;
}

.doc-container {
  max-width: 760px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.doc-subtitle,
.doc-meta {
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: 24px;
}

.prose h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 22px;
}

.prose h3 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 18px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.doc-cta {
  margin-top: 32px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.brand-footer-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.footer-note {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.footer-nav a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 900px) {
  .example-row,
  .specs-split {
    grid-template-columns: 1fr;
  }

  .example-row.is-reverse .example-media {
    order: 0;
  }

  .steps-rail {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 22px;
  }

  .container {
    padding: 0 16px;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 0;
    gap: 8px;
  }

  .site-nav {
    gap: 16px;
  }

  .steps-rail,
  .specs-matrix,
  .faq-index {
    grid-template-columns: 1fr;
  }

  .engage-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .page-section {
    padding: 32px 0;
  }
}
