/* =========================================================
   Rangoli Design — stylesheet
   Palette drawn from real rangoli pigments:
   ivory (rice flour), chalk-slate (ink), kumkum red,
   turmeric yellow, marigold orange, leaf green
   ========================================================= */

:root {
  --ivory: #FBF6EC;
  --ivory-deep: #F3EBDA;
  --ink: #2B2420;
  --ink-soft: #55483F;
  --kumkum: #C1272D;
  --turmeric: #E8A33D;
  --marigold: #E86A33;
  --leaf: #3F7D58;
  --indigo: #3B5378;
  --card-border: #E4D9C3;
  --max-width: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }

a:focus-visible,
button:focus-visible,
.step-svg-holder:focus-visible,
.step-color-toggle:focus-visible,
svg[tabindex]:focus-visible {
  outline: 2.5px solid var(--kumkum);
  outline-offset: 2px;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: 'Work Sans', 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--kumkum); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .display {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .4em;
}

.eyebrow {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--kumkum);
  line-height: 1;
}

.step-label {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.3rem;
  color: var(--kumkum);
  line-height: 1;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory);
  border-bottom: 1px solid var(--card-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.logo-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: conic-gradient(var(--kumkum), var(--turmeric), var(--marigold), var(--leaf), var(--kumkum));
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: .98rem;
}

.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--kumkum); text-decoration: none; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  color: var(--ink);
}
.nav-toggle:active { background: var(--ivory-deep); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 64px 24px 48px;
  background-image: radial-gradient(var(--card-border) 1.4px, transparent 1.4px);
  background-size: 26px 26px;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.1;
}

.hero p.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.hero-figure {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 12px 30px rgba(43,36,32,.08);
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  font-weight: 600;
  font-size: .96rem;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn.outline { background: transparent; color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: .85rem; border-radius: 8px; }

.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- 3D showcase (the house, on its dedicated Home page only) ----------
   Perspective/rotateX/translateZ live ONLY inside this stage, on a single
   raster <img> — never inside the gallery, and never on the live
   step-card SVGs, which is exactly the rasterization-blur trade-off
   noted above .step-card:hover. */
.hero-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.home-3d-stage {
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}
.home-3d-card {
  position: relative;
  width: min(100%, 320px);
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform .15s ease-out;
  will-change: transform;
}
.home-3d-card.float {
  animation: card-float 4.5s ease-in-out infinite;
}
@keyframes card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.home-3d-card img {
  width: 100%;
  display: block;
  border-radius: 10px;
  filter: drop-shadow(0 24px 30px rgba(43,36,32,.35));
  transform: translateZ(36px);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.home-3d-shadow {
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 65%;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(43,36,32,.35) 0%, rgba(43,36,32,0) 70%);
  transform: translateX(-50%);
  filter: blur(2px);
  transition: transform .15s ease-out;
}
.hero-3d-caption {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: var(--ink-soft);
  opacity: .75;
  margin: 0;
}
.hero-3d-caption a { color: var(--kumkum); }
@media (prefers-reduced-motion: reduce) {
  .home-3d-card { animation: none !important; }

}

/* ---------- Section shell ---------- */
section { padding: 56px 0; }
.section-head { max-width: 62ch; margin-bottom: 32px; }
.section-head h2 { font-size: 2rem; }
.section-head p { color: var(--ink-soft); }

.divider {
  height: 1px;
  background: var(--card-border);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---------- Design intro grid (jump nav to the 5 designs) ---------- */
.design-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.design-index a {
  display: block;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.design-index a:hover { border-color: var(--kumkum); }
.design-index .idx-name { font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; }
.design-index .idx-tag { color: var(--ink-soft); font-size: .88rem; }

/* ---------- Individual design block ---------- */
.design-block,
section,
article {
  scroll-margin-top: 84px; /* keeps headings clear of the sticky header on jump links */
}
.design-block {
  padding: 56px 0;
  border-top: 1px solid var(--card-border);
}
.design-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 28px;
}
.design-header .tag {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--leaf);
  background: #EAF2EC;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.design-header h2 { font-size: 2.1rem; }
.design-header .meta { color: var(--ink-soft); font-size: .95rem; margin-top: 12px; }

.hero-svg-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.hero-svg-card svg { width: 100%; height: auto; max-width: 320px; margin: 0 auto; }
.hero-svg-card .card-controls {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.copy-status {
  font-size: .85rem;
  color: var(--leaf);
  margin-top: 8px;
  min-height: 1.2em;
}
.copy-explainer {
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--ivory-deep);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-align: left;
}
.copy-explainer summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  padding: 4px 0;
}
.copy-explainer p { margin: 8px 0 4px; }

/* ---------- Steps ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 8px;
}
.step-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  position: relative;
  z-index: 1;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.step-card:hover,
.step-card:focus-within {
  /* Plain 2D transform on purpose — rotateX()/perspective()/translateZ()
     push the card into a 3D rendering context, and browsers handle that
     by rasterizing it once as a flat texture, then scaling that texture
     on the GPU rather than re-rendering it — which is exactly what was
     softening both the SVG lines and the step-label text on hover.
     A plain scale() + translateY() stays in the normal 2D paint path,
     so text and vector edges stay crisp at every size. */
  transform: translateY(-6px) scale(1.15);
  z-index: 20;
  border-color: var(--turmeric);
  box-shadow: 0 20px 40px rgba(43,36,32,.28), 0 6px 14px rgba(43,36,32,.16);
}

.step-card.copied-flash {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(63,125,88,.35), 0 16px 34px rgba(43,36,32,.22);
}
@media (prefers-reduced-motion: no-preference) {
  .step-card.copied-flash { transition: box-shadow .15s ease, border-color .15s ease; }
}
.step-svg-holder {
  cursor: pointer;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 4px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 42% 34%, #2a2a2a 0%, #161616 48%, #060606 100%);
  box-shadow:
    inset 0 3px 8px rgba(0, 0, 0, .75),
    inset 0 -2px 6px rgba(255, 255, 255, .05);
}
/* Fine grain, like rice-flour dust catching the light —
   blended over the design, not baked into it. */
.step-svg-holder::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .55) .6px, transparent .6px);
  background-size: 5px 5px;
  opacity: .07;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.step-svg-holder svg {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5));
}
.step-card .step-label {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
  line-height: 1.15;
}

/* Round tick button — only shown on the final stage of each design */
.step-color-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--turmeric);
  background: #fff;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.step-color-toggle[aria-pressed="true"] {
  background: var(--kumkum);
  border-color: var(--kumkum);
}
.step-color-toggle:hover { border-color: var(--kumkum); }

.step-status {
  font-size: .78rem;
  font-weight: 600;
  color: var(--leaf);
  min-height: 1.1em;
  margin-top: 4px;
}
.step-actions { margin-top: 6px; }
.step-download {
  padding: 4px 10px;
  font-size: .72rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--ivory-deep);
  color: var(--ink-soft);
  cursor: pointer;
}
.step-download:hover { border-color: var(--kumkum); color: var(--kumkum); }

.design-copy { margin-top: 26px; max-width: 68ch; }
.design-copy p { color: var(--ink-soft); }
.design-copy h3 { font-size: 1.25rem; margin-top: 22px; }

/* ---------- Quick gallery (compact uniform tiles, reference-style layout) ---------- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.quick-tile {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.quick-tile.wide { grid-column: span 2; }

.quick-tile .qsvg-holder {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-tile svg { max-width: 100%; max-height: 100%; cursor: pointer; }

.quick-tile .qaction-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.quick-tile .qcopy {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--ivory-deep);
  color: var(--ink-soft);
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-tile .qcopy:hover { border-color: var(--kumkum); color: var(--kumkum); }
.quick-tile .qtoggle {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #F0D9D9;
  background: #FBEAEA;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
}
.quick-tile .qtoggle:hover { background: #F6D8D8; }
.quick-tile.wide .qaction-row .qcopy { flex: 1; }
.quick-tile.wide .qtoggle { display: none; }

.quick-tile .qname {
  display: block;
  margin-top: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: .98rem;
  line-height: 1.15;
  text-align: center;
}
.quick-tile .qstatus { font-size: .68rem; color: var(--leaf); min-height: 1em; margin-top: 3px; text-align: center; }

/* ---------- Ad slot placeholder (kept commented/hidden until AdSense approval) ---------- */
.ad-slot {
  display: none; /* flip to block only after AdSense approval + real <ins> tag */
  max-width: var(--max-width);
  margin: 24px auto;
  text-align: center;
  color: var(--ink-soft);
  font-size: .8rem;
}

/* ---------- About / credits ---------- */
.credits-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
}
.credits-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 18px;
  list-style: none;
  padding: 0;
}
.credits-list li {
  border-left: 3px solid var(--turmeric);
  padding-left: 12px;
}
.credits-list .role { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.credits-list .who { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #EFE7D6;
  padding: 44px 0 26px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
.site-footer h4 { color: #fff; font-family: 'Work Sans', sans-serif; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.site-footer p, .site-footer a { color: #C9BFA8; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 30px auto 0;
  padding: 18px 24px 0;
  border-top: 1px solid #4A4038;
  font-size: .82rem;
  color: #A99C86;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

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

/* Tablet: stack the two-column layouts, keep steps at 3-wide */
@media (max-width: 880px) {
  .hero-inner, .design-header, .footer-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 48px 20px 36px; }
  .hero-figure { order: -1; }
  .home-3d-stage { min-height: 260px; }
}

/* Large phones / small tablets: hamburger nav takes over */
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--card-border);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--card-border); }
  .nav-links a { display: block; padding: 12px 0; }
  .nav { position: relative; padding: 12px 16px; }
}

/* Standard phones */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  section { padding: 40px 0; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .hero p.lede { max-width: none; font-size: 1rem; }
  .section-head h2 { font-size: 1.6rem; }
  .design-header h2 { font-size: 1.6rem; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .step-card { padding: 8px; }
  .step-card .step-label { font-size: 1.05rem; }
  .credits-list { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; }
  .hero-svg-card svg { max-width: 240px; }
}

/* Small / older phones */
@media (max-width: 400px) {
  .logo { font-size: 1.3rem; }
  .hero { padding: 36px 14px 28px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-actions { flex-direction: column; }
  .btn { text-align: center; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .step-card .step-label { font-size: 1rem; }
  .card-controls { flex-direction: column; }
  .card-controls .btn { width: 100%; }
  .credits-list { grid-template-columns: 1fr; }
  .design-header .tag { font-size: .72rem; }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .step-card { transition: none; }
  .step-card:hover,
  .step-card:focus-within { transform: scale(1.15); }
}
