/* ── living-the-grid.com 1:1 replica styles ── */

:root {
  --bg: #fef8e0;
  --card: #fffdf5;
  --ink: #2e251b;
  --line: #2e251b;
  --border-w: 3px;
  --r: 20px;
  --r-pill: 999px;
  --cyan: #7fdfef;
  --coral: #ff7f6d;
  --font: "Patrick Hand", "Short Stack", cursive, sans-serif;
  --font-head: "Short Stack", "Patrick Hand", cursive, sans-serif;
}

html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}

/* ─── Top bar ─── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: var(--border-w) solid var(--line);
  position: relative;
  z-index: 1;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  height: 36px;
  width: 36px;
  object-fit: cover;
  border-radius: 8px;
}

.nav-text {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.top-links { display: flex; gap: 10px; align-items: center; }

.top-links a {
  font-family: var(--font-head);
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 0;
  transition: color 0.15s;
}

.top-links a:hover { color: var(--coral); }

/* ─── Landing ─── */
.landing {
  max-width: 860px;
  margin: 40px auto 36px;
  text-align: center;
  padding: 0 20px;
}

/* ─── Hero banner ─── */
.hero-banner {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 24px;
  text-align: center;
}

.hero-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
  mix-blend-mode: multiply;
}

.site-title {
  font-family: var(--font-head);
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 8px;
}

.tagline {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: #5a4f3c;
  margin-bottom: 10px;
  line-height: 1.45;
}

.intro {
  font-size: 1rem;
  color: #5a4f3c;
  margin-bottom: 6px;
  line-height: 1.55;
}

.upload-box {
  display: block;
  max-width: 560px;
  margin: 20px auto 10px;
  border: var(--border-w) dashed #8b7b65;
  border-radius: var(--r);
  background: var(--card);
  padding: 24px 16px;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--ink);
}

.upload-box:hover { border-color: var(--ink); }
.upload-box small { display: block; font-size: 0.82rem; color: #8b7b65; margin-top: 6px; }
.upload-box input { display: none; }

.demo-link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: 0.88rem;
  color: #5a7fbf;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hidden { display: none !important; }

/* ─── Privacy ─── */
.privacy {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.9rem;
  color: #6e6050;
  border: 2px dashed #b5a48e;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--card);
}

.privacy::before { content: "🔒 "; }

/* ─── Home modules ─── */
.home-modules {
  max-width: 960px;
  margin: 0 auto 48px;
  padding: 0 20px;
  display: grid;
  gap: 28px;
}

/* ─── Section titles ─── */
.core-features-title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 400;
  text-align: center;
  color: var(--ink);
  margin: 0 0 -2px;
}

/* ─── Feature pills ─── */
.features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-pill {
  border: var(--border-w) solid var(--line);
  border-radius: var(--r);
  padding: 16px 14px;
  background: var(--card);
}

.feature-pill h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 6px;
}

.feature-pill p {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #4a3f2f;
}

/* ─── Blog link cards ─── */
.blog-links { grid-template-columns: repeat(2, 1fr); }

.blog-card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.blog-card:hover {
  border-color: var(--coral);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.blog-card h3 { color: #5a7fbf; }

/* ─── Module card (generic) ─── */
.module-card {
  border: var(--border-w) solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  background: var(--card);
}

.module-card h2, .module-card h3 {
  font-family: var(--font-head);
  font-weight: 400;
  margin-bottom: 10px;
}

.module-card p {
  font-size: 0.94rem;
  line-height: 1.55;
  color: #4a3f2f;
}

/* ─── About card ─── */
.about-card .core-features-title {
  margin-bottom: 12px;
}

.about-card p {
  margin-bottom: 10px;
}

.about-card p:last-child { margin-bottom: 0; }

/* ─── Contact card ─── */
.contact-card {
  text-align: center;
}

.contact-card h3 { font-size: 1.08rem; }

.contact-card a {
  display: inline-block;
  margin-top: 8px;
  color: #5a7fbf;
  font-family: var(--font-head);
  text-decoration: none;
  font-size: 0.95rem;
}

.contact-card a:hover { text-decoration: underline; }

/* ─── FAQ ─── */
.faq-card {
  background: transparent;
  border: none;
  padding: 0;
}

.faq-card > h2 {
  text-align: center;
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.faq-subtitle {
  text-align: center;
  font-size: 0.92rem;
  color: #6e6050;
  margin-bottom: 16px;
}

.faq-card details {
  border: var(--border-w) solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  margin-bottom: 10px;
}

.faq-card summary {
  list-style: none;
  padding: 14px 46px 14px 16px;
  font-family: var(--font-head);
  font-size: 0.96rem;
  cursor: pointer;
  position: relative;
}

.faq-card summary::-webkit-details-marker { display: none; }

.faq-card summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--coral);
}

.faq-card details[open] summary::after { content: "−"; }

.faq-card details p {
  padding: 0 16px 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #4a3f2f;
}

/* ─── Workspace header ─── */
.workspace-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 10px;
  border-bottom: 2px dashed #c8b89c;
  margin-bottom: 4px;
}

.back-btn {
  font-family: var(--font-head);
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  cursor: pointer;
}

.back-btn:hover { background: #ffeeb6; }

.workspace-logo {
  font-family: var(--font-head);
  font-size: 1rem;
  color: #7d6f57;
}

/* ─── Workspace ─── */
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px 36px;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar, .info-bar, .canvas-wrap, .colour-panel {
  background: var(--card);
  border: var(--border-w) solid var(--line);
  border-radius: 16px;
}

.sidebar {
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.tool-group { border-top: 2px dashed #c8b89c; padding-top: 8px; }
.tool-group:first-child { border-top: 0; padding-top: 0; }

.tool-group h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 6px;
}

.chip-grid, .row-wrap { display: flex; flex-wrap: wrap; gap: 7px; }

.chip, .pill, .yellow-btn, .blue-btn, .zoom-box button {
  border: var(--border-w) solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 6px 10px;
  font-family: var(--font-head);
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--ink);
}

.pill { border-radius: var(--r-pill); }
.chip-active, .pill-active { background: var(--cyan); }

.line-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.line-title strong {
  min-width: 40px;
  text-align: center;
  border: var(--border-w) solid var(--line);
  border-radius: 8px;
  background: #ffe9a0;
  padding: 1px 6px;
  font-size: 0.9rem;
}

label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-size: 0.9rem;
}

input[type="range"] { width: 100%; accent-color: #ef8d73; }

.hint { margin: 6px 0 0; text-align: center; font-size: 0.84rem; color: #7d6f57; }

.link-btn {
  border: 2px dashed #8b7b65;
  border-radius: var(--r-pill);
  background: #fff8e6;
  padding: 3px 10px;
  font-family: var(--font-head);
  font-size: 0.8rem;
  cursor: pointer;
}

.hex-row input {
  width: 100%;
  border: var(--border-w) solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.92rem;
  font-family: var(--font);
}

.hsb-row {
  border: 2px dashed #8b7b65;
  border-radius: 8px;
  text-align: center;
  padding: 4px 8px;
  margin: 6px 0 3px;
  font-size: 0.88rem;
  color: #5a4f3c;
}

.main-view { display: grid; gap: 14px; align-content: start; }

.info-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-size: 0.84rem;
}

.info-bar p { margin: 0; }

.canvas-wrap { padding: 10px; background: #ffeeb6; }

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.yellow-btn { background: #ffd951; border-radius: var(--r-pill); }

.zoom-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-pill);
  background: #fff;
  padding: 3px 8px;
}

.zoom-box button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  padding: 0;
  background: #ffd951;
}

#pixelCanvas {
  width: 100%;
  max-width: 480px;
  max-height: 480px;
  aspect-ratio: 1;
  background: #fff;
  border: var(--border-w) solid var(--line);
  border-radius: 8px;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}

.download-row {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.blue-btn {
  border-radius: var(--r-pill);
  background: var(--cyan);
  min-width: 140px;
}

/* ─── Colour panel ─── */
.colour-panel { padding: 12px; }

.colour-panel h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.colour-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 10px 8px;
}

.swatch {
  border: 1px solid #c8c2b7;
  border-radius: var(--r-pill);
  min-height: 34px;
  position: relative;
  cursor: pointer;
}

.swatch.used { border: var(--border-w) solid var(--line); }

.rainbow-strip {
  border-left: 3px dotted var(--line);
  padding-left: 8px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.rainbow-strip span {
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  display: block;
}

.swatch-tag {
  position: absolute;
  left: -8px;
  top: -6px;
  background: #3f3123;
  color: #fff6d0;
  border: 2px solid #251a12;
  border-radius: var(--r-pill);
  padding: 1px 6px;
  font-size: 0.6rem;
  font-family: var(--font-head);
}

.swatch-check {
  position: absolute;
  right: -7px;
  bottom: -8px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid #2b2018;
  background: #2b2018;
  color: #ffe586;
  font-size: 0.7rem;
  line-height: 13px;
  text-align: center;
  font-family: var(--font-head);
}

.palette-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: #7d6f57;
}

/* ─── Footer ─── */
.site-footer {
  text-align: center;
  padding: 14px 10px;
  border-top: var(--border-w) solid var(--line);
  font-size: 0.82rem;
  color: #7d6f57;
}

.site-footer a { color: #5a7fbf; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════
   TABLET  (≤ 1100px)
   ═══════════════════════════════════════ */
@media (max-width: 1100px) {
  .top-bar { padding: 10px 18px; }

  .landing {
    max-width: 580px;
    margin: 32px auto 32px;
  }

  .home-modules {
    max-width: 620px;
    padding: 0 18px;
  }

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

  .feature-pill { min-height: auto; }

  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 10px 24px;
  }

  #pixelCanvas { max-height: 70vh; }

  .palette {
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 8px 6px;
  }

  .swatch { min-height: 28px; }
}

/* ═══════════════════════════════════════
   MOBILE  (≤ 700px)
   ═══════════════════════════════════════ */
@media (max-width: 700px) {
  /* Nav */
  .top-bar {
    padding: 10px 14px;
  }

  .nav-icon { height: 28px; width: 28px; }
  .nav-text { font-size: 0.88rem; }
  .top-links { flex-wrap: wrap; gap: 6px; }
  .top-links a { font-size: 0.78rem; }

  /* Landing */
  .landing {
    max-width: 100%;
    margin: 24px auto 24px;
    padding: 0 14px;
  }

  .hero-banner { max-width: 360px; margin-bottom: 18px; }
  .hero-img { max-width: 240px; }

  .site-title { font-size: 1.9rem; }
  .tagline { font-size: 0.94rem; }
  .intro { font-size: 0.9rem; }

  .upload-box {
    padding: 18px 12px;
    font-size: 0.95rem;
    border-radius: 16px;
  }

  .demo-link { font-size: 0.84rem; }

  /* Privacy */
  .privacy { font-size: 0.84rem; padding: 10px 14px; }

  /* Home modules */
  .home-modules {
    max-width: 100%;
    margin-bottom: 32px;
    gap: 18px;
    padding: 0 14px;
  }

  .core-features-title { font-size: 1.18rem; }

  .features-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .blog-links { grid-template-columns: 1fr; }

  .feature-pill {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .feature-pill h3 { font-size: 0.94rem; }
  .feature-pill p { font-size: 0.88rem; }

  /* FAQ */
  .faq-card > h2 { font-size: 1.18rem; }
  .faq-subtitle { font-size: 0.86rem; margin-bottom: 12px; }

  .faq-card details { border-radius: 16px; }

  .faq-card summary {
    padding: 12px 40px 12px 14px;
    font-size: 0.9rem;
  }

  .faq-card details p {
    padding: 0 14px 12px;
    font-size: 0.86rem;
  }

  /* About & Contact */
  .module-card { padding: 16px 14px; border-radius: 16px; }
  .about-card p { font-size: 0.88rem; }
  .contact-card h3 { font-size: 1rem; }
  .contact-card a { font-size: 0.88rem; }

  /* Workspace */
  .workspace {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 10px 20px;
  }

  .workspace-header { padding: 0 2px 8px; }
  .back-btn { font-size: 0.84rem; padding: 5px 12px; }
  .workspace-logo { font-size: 0.9rem; }

  .sidebar { max-height: none; }

  .sidebar { padding: 10px; border-radius: 14px; }
  .info-bar, .canvas-wrap, .colour-panel { border-radius: 14px; }
  .tool-group h3 { font-size: 0.88rem; }

  .chip, .pill, .yellow-btn, .blue-btn {
    font-size: 0.8rem;
    padding: 5px 9px;
  }

  .info-bar { padding: 8px 10px; gap: 4px; }
  .info-bar p { width: 100%; font-size: 0.8rem; }

  .canvas-toolbar { flex-wrap: wrap; gap: 6px; }
  .download-row { justify-content: center; }
  .blue-btn { width: 100%; max-width: 260px; }

  /* Colour panel mobile */
  .colour-panel h3 { font-size: 1rem; }
  .colour-layout { grid-template-columns: 1fr; }

  .rainbow-strip {
    border-left: 0;
    border-top: 3px dotted var(--line);
    padding-left: 0;
    padding-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .rainbow-strip span { width: 24px; height: 24px; }

  .palette {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px 6px;
  }

  .swatch { min-height: 28px; }
  .palette-note { font-size: 0.78rem; }

  /* Footer */
  .site-footer { font-size: 0.78rem; padding: 12px 10px; }
}

/* ═══════════════════════════════════════
   SMALL PHONES  (≤ 420px)
   ═══════════════════════════════════════ */
@media (max-width: 420px) {
  .top-bar { padding: 8px 12px; }
  .nav-icon { height: 22px; width: 22px; border-radius: 6px; }
  .nav-text { font-size: 0.78rem; }
  .top-links a { font-size: 0.72rem; }

  .landing { margin: 18px auto 20px; padding: 0 12px; }
  .hero-banner { max-width: 300px; margin-bottom: 14px; }
  .hero-img { max-width: 200px; }
  .site-title { font-size: 1.55rem; }
  .tagline { font-size: 0.88rem; }
  .intro { font-size: 0.86rem; }

  .upload-box { padding: 16px 10px; font-size: 0.9rem; }
  .upload-box small { font-size: 0.76rem; }

  .home-modules { gap: 14px; padding: 0 10px; }
  .privacy { font-size: 0.8rem; padding: 8px 10px; }

  .core-features-title { font-size: 1.08rem; }
  .feature-pill h3 { font-size: 0.9rem; }
  .feature-pill p { font-size: 0.84rem; }

  .faq-card > h2 { font-size: 1.08rem; }
  .faq-card summary { font-size: 0.86rem; padding: 10px 36px 10px 12px; }
  .faq-card details p { font-size: 0.82rem; padding: 0 12px 10px; }

  .module-card p { font-size: 0.84rem; }

  .workspace { padding: 8px 6px 16px; }
  .sidebar { padding: 8px; }
  .tool-group h3 { font-size: 0.84rem; }
  .chip, .pill, .yellow-btn, .blue-btn { font-size: 0.76rem; padding: 4px 7px; }

  .palette { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .swatch { min-height: 24px; }
}
