/* Batik Reborn — "atelier kain": warm paper, ink brown, terracotta + turmeric. */

:root {
  --paper: #f6efe0;
  --paper-hi: #fbf6ea;
  --ink: #2e1a0e;
  --ink-soft: #5c4630;
  --terra: #b4552d;
  --gold: #d9a441;
  --wood: #7a4f2a;
  --wood-dark: #5d3a1d;
  --line: #d8c9a8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% -10%, #fff8 0%, transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 3px, #00000006 3px 4px);
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 300;
  min-height: 100vh;
  padding: 0 clamp(14px, 4vw, 48px) 40px;
}

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.78rem; letter-spacing: 0.02em; }

/* ---- masthead ---- */
.masthead {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: 28px 0 18px; border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 14px; }
.canting { width: 46px; height: 46px; color: var(--terra); flex: none; }
h1 { font-weight: 900; font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -0.01em; line-height: 1; }
.tagline { font-style: italic; color: var(--terra); font-size: clamp(0.9rem, 1.6vw, 1.1rem); margin-top: 4px; }
.colophon { text-align: right; color: var(--ink-soft); font-size: 0.85rem; line-height: 1.5; }

/* ---- the loom (hero cloth) ---- */
.loom { margin: 26px 0 8px; }
.stretcher {
  position: relative;
  padding: 16px 12px;
  background:
    linear-gradient(180deg, var(--wood) 0%, var(--wood-dark) 50%, var(--wood) 100%);
  border-radius: 6px;
  box-shadow: 0 18px 40px -18px #2e1a0e88, inset 0 2px 0 #ffffff30;
}
.bar { position: absolute; left: 0; right: 0; height: 8px; background: var(--wood-dark); opacity: 0.55; }
.bar-top { top: 4px; border-radius: 4px 4px 0 0; }
.bar-bottom { bottom: 4px; border-radius: 0 0 4px 4px; }
.cloth {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 16 / 8.5;
  box-shadow: inset 0 0 0 1px #00000022, inset 0 0 60px #00000030;
}
.cloth::after {
  /* woven grain */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, #00000010 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.cloth svg { width: 100%; height: 100%; display: block; }
.cloth-meta { margin-top: 10px; color: var(--ink-soft); text-align: center; }

/* ---- workbench ---- */
.bench {
  display: grid; gap: 14px; margin: 18px 0 26px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.panel {
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 16px;
  box-shadow: 0 2px 0 #0000000a;
}
.panel-title {
  font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--terra); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline;
}

.motif-list { display: flex; flex-wrap: wrap; gap: 8px; }
.motif-chip {
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-family: inherit; font-weight: 600; font-size: 0.9rem;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.motif-chip:hover { transform: translateY(-1px); }
.motif-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper-hi); }

.palette-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pot {
  display: flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 5px 11px 5px 6px; cursor: pointer; font-family: inherit; font-size: 0.82rem; color: var(--ink);
}
.pot[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.pot .drops { display: flex; }
.pot .drops i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #0003; margin-left: -4px; display: block; }
.pot .drops i:first-child { margin-left: 0; }

.ctl { display: grid; grid-template-columns: 64px 1fr 52px; align-items: center; gap: 10px; margin: 10px 0; font-size: 0.9rem; }
.ctl output { font-family: "IBM Plex Mono", monospace; font-size: 0.75rem; text-align: right; color: var(--ink-soft); }
input[type="range"] { accent-color: var(--terra); width: 100%; }

.btn {
  display: block; width: 100%; margin: 8px 0;
  background: var(--ink); color: var(--paper-hi); border: none; border-radius: 6px;
  font-family: inherit; font-weight: 600; font-size: 0.92rem; padding: 11px 14px; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--terra); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper-hi); }

/* ---- catalog card ---- */
.catalog {
  max-width: 760px; margin: 0 auto;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px clamp(18px, 4vw, 40px) 22px;
  box-shadow: 0 14px 30px -20px #2e1a0e66;
  position: relative;
}
.catalog::before {
  content: ""; position: absolute; top: 10px; bottom: 10px; left: 10px; right: 10px;
  border: 1px solid var(--line); border-radius: 2px; pointer-events: none;
}
.card-head { display: flex; justify-content: space-between; color: var(--terra); margin-bottom: 6px; }
.catalog h2 { font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 14px; }
.catalog dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; }
.catalog dt { font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.14em; color: var(--terra); padding-top: 3px; }
.catalog dd { line-height: 1.65; font-size: 0.98rem; }
.card-note { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--line); font-style: italic; font-size: 0.82rem; color: var(--ink-soft); }

footer { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); text-align: center; }

@media (max-width: 720px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 10px; }
  .colophon { text-align: left; }
  .cloth { aspect-ratio: 4 / 5; }
  .catalog dl { grid-template-columns: 1fr; gap: 2px 0; }
  .catalog dd { margin-bottom: 10px; }
}
