/* ===== Cotton Coat — palette from the logo ===== */
:root {
  --cream: #FBF4E3;
  --cream-deep: #F3E6CC;
  --paper: #FFFDF7;
  --orange: #C8643C;   /* COT */
  --orange-dk: #B0512E;
  --tan: #DDB078;      /* TON */
  --tan-soft: #E7C796;
  --brown: #8C5A3B;    /* COAT */
  --brown-dk: #6E452C;
  --ink: #3A2A1A;
  --muted: #7A6650;
  --line: #E6D6B6;
  --shadow: 0 14px 38px rgba(110, 69, 44, 0.14);
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, .brand-name, .price {
  font-family: Georgia, "Times New Roman", serif;
}

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

/* ===== Buttons ===== */
.btn {
  font: inherit;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.7em 1.4em;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, box-shadow .2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dk); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--brown); border-color: var(--tan); }
.btn-ghost:hover { background: var(--cream-deep); }
.btn-ghost[aria-pressed="true"] { background: var(--brown); color: #fff; border-color: var(--brown); }
.btn-lg { padding: 0.85em 1.7em; font-size: 1.05rem; }
.btn-sm { padding: 0.5em 0.9em; font-size: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem clamp(1rem, 4vw, 3rem);
  background: rgba(251, 244, 227, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-logo { width: 48px; height: auto; }
.brand-name { font-size: 1.35rem; font-weight: 700; color: var(--brown); }
.nav { display: flex; align-items: center; gap: clamp(.6rem, 2vw, 1.6rem); }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--orange); }
.nav-cta { margin-left: .3rem; }

/* ===== Hero ===== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem);
  max-width: 1180px; margin: 0 auto;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em;
  font-size: .8rem; font-weight: 700; color: var(--orange); margin: 0 0 .6rem;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.1; margin: 0 0 1.1rem; color: var(--ink); }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 .9rem; }
.hero-note { font-size: .92rem; color: var(--brown); font-weight: 600; }
.hero-art img {
  margin: 0 auto;
  filter: drop-shadow(0 22px 40px rgba(110,69,44,.25));
  max-width: 340px;
}

/* ===== Sections ===== */
.section { max-width: 1100px; margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 5vw, 2rem); }
.section-tint { max-width: none; background: var(--cream-deep); }
.section-tint > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); text-align: center; margin: 0 0 .5rem; color: var(--brown); }
.section-sub { text-align: center; color: var(--muted); max-width: 60ch; margin: 0 auto 2.5rem; font-size: 1.05rem; }

/* ===== Features ===== */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.feature {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.3rem; text-align: center;
}
.feature-ic {
  width: 54px; height: 54px; margin: 0 auto .9rem;
  display: grid; place-items: center; font-size: 1.5rem;
  background: var(--cream); color: var(--orange);
  border-radius: 50%; border: 2px solid var(--tan-soft);
}
.feature h3 { margin: 0 0 .4rem; font-size: 1.15rem; color: var(--brown-dk); }
.feature p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ===== Pricing ===== */
.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 320px)); gap: 1.5rem; justify-content: center; }
.price-card {
  position: relative; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem 1.8rem; text-align: center;
}
.price-card-feature { border: 2px solid var(--orange); box-shadow: var(--shadow); }
.badge {
  position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%);
  background: var(--orange); color: #fff; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .3em .9em; border-radius: 999px;
}
.price-card h3 { margin: 0 0 .3rem; color: var(--brown-dk); font-size: 1.4rem; }
.price { font-size: 3.2rem; margin: .2rem 0; color: var(--orange); line-height: 1; }
.price span { font-size: 1.6rem; vertical-align: super; }
.price-desc { color: var(--muted); margin: 0 0 1.2rem; font-weight: 600; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 1.6rem; text-align: left; }
.price-card li { padding: .35rem 0 .35rem 1.6rem; position: relative; color: var(--ink); }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--tan); font-weight: 700; }

/* ===== Design Studio ===== */
.studio {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem; max-width: 880px; margin: 0 auto;
}
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem;
  padding: .6rem .4rem 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem;
}
.tool-group { display: flex; align-items: center; gap: .5rem; }
.tool-group-end { margin-left: auto; }
.tool-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.swatches { display: flex; gap: .3rem; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--orange); transform: scale(1.12); }
#customColor { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
#brushSize { width: 110px; accent-color: var(--orange); }
.brush-val { width: 1.6em; text-align: center; font-weight: 700; color: var(--brown); }
.canvas-wrap { display: flex; justify-content: center; }
#coverCanvas {
  width: 320px; height: 400px; max-width: 100%;
  background: var(--cream);
  border: 3px solid var(--tan); border-radius: 10px;
  box-shadow: var(--shadow); cursor: crosshair; touch-action: none;
}
.studio-hint { text-align: center; color: var(--muted); font-size: .9rem; margin: 1rem 0 .2rem; }

/* ===== FAQ ===== */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; padding: .3rem 1.2rem; margin-bottom: .8rem;
}
.faq summary { cursor: pointer; font-weight: 700; color: var(--brown-dk); padding: .8rem 0; list-style: none; }
.faq summary::after { content: "+"; float: right; color: var(--orange); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 1rem; color: var(--muted); }

/* ===== CTA ===== */
.cta {
  text-align: center; padding: clamp(3rem, 7vw, 5rem) 1.5rem;
  background: var(--brown); color: var(--cream);
}
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .6rem; color: #fff; }
.cta p { margin: 0 0 1.6rem; opacity: .9; }

/* ===== Footer ===== */
.site-footer { text-align: center; padding: 2.5rem 1rem; background: var(--cream-deep); color: var(--muted); }
.foot-logo { width: 44px; margin: 0 auto .6rem; }
.foot-mail a { color: var(--orange); font-weight: 600; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(58, 42, 26, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; background: var(--paper);
  border-radius: var(--radius); padding: 2rem clamp(1.2rem, 4vw, 2.4rem);
  max-width: 520px; width: 100%; box-shadow: var(--shadow);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-close {
  position: absolute; top: .8rem; right: 1rem; border: none; background: none;
  font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal h2 { margin: 0 0 .3rem; color: var(--brown); }
.modal-sub { margin: 0 0 1.4rem; color: var(--muted); font-size: .95rem; }
.order-form { display: flex; flex-direction: column; gap: .9rem; }
.order-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; color: var(--brown-dk); font-size: .92rem; }
.order-form input, .order-form textarea {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--ink);
}
.order-form input:focus, .order-form textarea:focus { outline: 2px solid var(--tan); border-color: var(--tan); }
.opt-group { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin: 0; }
.opt-group legend { font-weight: 700; color: var(--brown-dk); padding: 0 .4rem; font-size: .9rem; }
.radio { flex-direction: row !important; align-items: center; gap: .6rem !important; cursor: pointer; padding: .25rem 0; }
.radio input { width: auto; accent-color: var(--orange); }
.radio small { color: var(--muted); font-weight: 400; }
.design-flag { background: var(--cream); border: 1px dashed var(--tan); border-radius: 9px; padding: .6rem .8rem; color: var(--brown-dk); font-weight: 600; font-size: .9rem; margin: 0; }
.modal-fineprint { text-align: center; font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }

/* ===== Size select ===== */
.size-select {
  font: inherit; font-size: .88rem; font-weight: 600;
  padding: .45em .7em; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--brown-dk);
  cursor: pointer; accent-color: var(--orange);
}
.size-select:focus { outline: 2px solid var(--tan); }

/* ===== Canvas stage (overlay for guide) ===== */
.canvas-stage {
  position: relative;
  width: 320px; max-width: 100%;
}
.canvas-stage canvas { width: 100%; height: auto; display: block; }
#guideCanvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; border-radius: 10px;
}

/* ===== Image picker panel ===== */
.img-panel {
  border: 1px dashed var(--tan); border-radius: 12px;
  background: var(--paper); margin-bottom: 1rem;
  animation: pop .15s ease;
}
.img-panel[hidden] { display: none; }
.img-panel-inner { padding: .9rem 1rem; }
.img-panel-title {
  font-weight: 700; font-size: .88rem; color: var(--brown-dk);
  margin: 0 0 .65rem;
}
.img-panel-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
}
.img-upload-label {
  cursor: pointer; display: inline-flex; align-items: center; gap: .3em;
}
.img-sep { color: var(--muted); font-size: .88rem; }
.img-url-input {
  flex: 1 1 200px; font: inherit; font-size: .88rem;
  padding: .5em .7em; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); min-width: 0;
}
.img-url-input:focus { outline: 2px solid var(--tan); border-color: var(--tan); }
.img-panel-hint {
  margin: .6rem 0 0; font-size: .82rem; color: var(--muted); line-height: 1.5;
}
.img-cors-warn {
  margin: .5rem 0 0; font-size: .82rem; font-weight: 600;
  color: var(--orange-dk); background: #fff3ed;
  border: 1px solid #f4c9ae; border-radius: 8px; padding: .45rem .7rem;
}
.img-cors-warn[hidden] { display: none; }

/* ===== Password Gate ===== */
#passwordGate {
  position: fixed; inset: 0; z-index: 999;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  transition: opacity .4s ease;
}
#passwordGate.gate-hide {
  opacity: 0; pointer-events: none;
}
.gate-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.5rem 2rem;
  max-width: 360px; width: 100%; text-align: center;
  box-shadow: var(--shadow);
}
.gate-logo { width: 90px; margin: 0 auto 1rem; }
.gate-title { font-family: Georgia,'Times New Roman',serif; font-size: 1.7rem; color: var(--brown); margin: 0 0 .3rem; }
.gate-sub   { color: var(--muted); margin: 0 0 1.4rem; font-size: .95rem; }
.gate-form  { display: flex; flex-direction: column; gap: .8rem; }
.gate-input {
  font: inherit; font-size: 1rem; padding: .7rem .9rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); text-align: center;
  letter-spacing: .1em;
}
.gate-input:focus { outline: 2px solid var(--tan); border-color: var(--tan); }
.gate-error {
  margin: .6rem 0 0; font-size: .88rem; font-weight: 600;
  color: var(--orange); animation: shake .3s ease;
}
.gate-error[hidden] { display: none; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; }
  .lede { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .nav a:not(.nav-cta) { display: none; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .toolbar { gap: .8rem 1rem; }
  .tool-group-end { margin-left: 0; width: 100%; }
}
