/* Kadele Studio — proposal demo design system
   Brand preserved from kadele.cc: Kadele red accent on warm paper white.
   Shape rule: buttons = pill, cards = 16px, inputs = 10px. */

@font-face {
  font-family: 'Outfit';
  src: url('fonts/outfit-latin.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --ink: #23201B;
  --ink-soft: #6B655C;
  --line: #E7E2D9;
  --accent: #D6363A;
  --accent-deep: #B02A31;
  --accent-tint: #FAECE8;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-card: 16px;
  --r-input: 10px;
  --shadow: 0 10px 30px rgba(120, 90, 60, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  height: 66px; display: flex; align-items: center; gap: 28px;
}
.wordmark { display: flex; align-items: baseline; gap: 7px; text-decoration: none; }
.wordmark b { font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--accent); }
.wordmark span { font-weight: 600; font-size: 15px; color: var(--ink-soft); letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 24px; margin-left: 8px; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-cta { margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: none; text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 12px 24px; white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* --------------------------------------------------------------- hero */

.hero { padding: 64px 0 40px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5vw, 58px); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.04; margin-bottom: 18px;
}
.hero h1 em { font-style: italic; color: var(--accent); line-height: 1.1; padding-bottom: 4px; }
.hero p.lead { font-size: 19px; color: var(--ink-soft); max-width: 44ch; margin-bottom: 28px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-stage { position: relative; }
.hero-stage canvas { width: 100%; height: 460px; display: block; cursor: grab; }
.hero-stage canvas:active { cursor: grabbing; }
.stage-hint {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  font-size: 13px; color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  pointer-events: none; white-space: nowrap;
}

/* --------------------------------------------------------------- stats */

.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-row { display: flex; justify-content: space-between; gap: 24px; padding: 26px 0; flex-wrap: wrap; }
.stat { display: flex; align-items: baseline; gap: 10px; }
.stat b { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-family: var(--mono); }
.stat span { color: var(--ink-soft); font-size: 15px; }

/* ------------------------------------------------------------- sections */

.section { padding: 88px 0; }
.section-head { max-width: 620px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 12px; }
.section-head p { color: var(--ink-soft); font-size: 17px; }

/* bento: three ways to create */
.bento { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: repeat(2, 260px); gap: 20px; }
.bento a.cell { text-decoration: none; }
.cell {
  position: relative; border-radius: var(--r-card); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cell:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cell-photo { grid-row: 1 / 3; }
.cell-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cell-photo .cell-copy { position: relative; background: linear-gradient(transparent, rgba(20, 16, 12, 0.82) 45%); color: #fff; }
.cell-photo .cell-copy p { color: rgba(255, 255, 255, 0.85); }
.cell-tint { background: var(--accent-tint); }
.cell-copy { padding: 22px 24px; }
.cell-copy h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.cell-copy p { font-size: 15px; color: var(--ink-soft); max-width: 46ch; }
.cell-art { position: absolute; top: 14px; right: 16px; height: 62%; display: flex; align-items: flex-start; justify-content: flex-end; }
.cell-art img { height: 100%; width: auto; }
.cell-kicker { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.cell-photo .cell-kicker { color: #FFB3A8; }

/* why fourteen faces */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 16px; }
.split .prose p { color: var(--ink-soft); font-size: 16.5px; margin-bottom: 14px; max-width: 54ch; }
.bead-stage canvas { width: 100%; height: 380px; cursor: grab; }
.facts { display: flex; gap: 28px; margin-top: 22px; }
.fact b { display: block; font-size: 26px; font-weight: 800; font-family: var(--mono); }
.fact span { font-size: 14px; color: var(--ink-soft); }

/* pipeline steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.step { padding: 26px 26px 26px 0; border-top: 2px solid var(--line); position: relative; counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; top: -14px; left: 0;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  background: var(--bg); padding-right: 10px; color: var(--accent);
}
.step h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.step p { font-size: 14.5px; color: var(--ink-soft); }

/* red band */
.band { background: var(--accent); color: #fff; }
.band .section-head h2 { color: #fff; }
.band .section-head p { color: rgba(255, 255, 255, 0.85); }
.band-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.band-col h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.band-col p { font-size: 15px; color: rgba(255, 255, 255, 0.88); }
.band-col .num-big { font-family: var(--mono); font-size: 15px; display: block; margin-top: 12px; color: #FFD9CF; }

/* classic kits scroll row */
.kits { display: grid; grid-auto-flow: column; grid-auto-columns: 240px; gap: 18px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.kit { scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; text-decoration: none; transition: transform 0.2s ease; }
.kit:hover { transform: translateY(-3px); }
.kit img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.kit-meta { padding: 14px 16px 16px; }
.kit-meta h3 { font-size: 15.5px; font-weight: 600; margin-bottom: 3px; }
.kit-meta span { font-size: 14px; color: var(--ink-soft); font-family: var(--mono); }

/* community teaser + model cards */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.model-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
}
.model-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.model-card .thumb { aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #F4F0E8, #EAE5DA); display: grid; place-items: center; }
.model-card .thumb img { width: 88%; height: 88%; object-fit: contain; }
.model-meta { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 3px; }
.model-meta h3 { font-size: 17px; font-weight: 700; }
.model-meta .by { font-size: 14px; color: var(--ink-soft); }
.model-meta .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.model-meta .dl { font-size: 13.5px; color: var(--ink-soft); font-family: var(--mono); }

/* footer */
footer { border-top: 1px solid var(--line); padding: 44px 0 56px; margin-top: 40px; }
.foot { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { font-size: 14.5px; color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-note { font-size: 13px; color: var(--ink-soft); max-width: 60ch; margin-top: 14px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ------------------------------------------------------------- studio */

.studio-main { padding: 28px 0 56px; }
.studio-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.studio-top h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.tabs { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.tab {
  border: none; background: transparent; border-radius: 999px;
  padding: 9px 18px; font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
}
.tab[aria-selected="true"] { background: var(--accent); color: #fff; }

.bench { display: grid; grid-template-columns: 300px 1fr 320px; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; }
.panel h2 { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; margin-bottom: 12px; }

.lib-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.lib-item {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; background: transparent;
  text-align: left; transition: border-color 0.15s ease;
}
.lib-item:hover { border-color: var(--ink-soft); }
.lib-item.active { border-color: var(--accent); background: var(--accent-tint); }
.lib-item img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: #F1EDE4; }
.lib-item b { display: block; font-size: 14.5px; font-weight: 700; font-family: 'Outfit', system-ui, sans-serif; }
.lib-item span { font-size: 12.5px; color: var(--ink-soft); font-family: var(--mono); }

.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
textarea, select, input[type="text"], input[type="search"] {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-input);
  padding: 10px 12px; font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--bg); resize: vertical;
}
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.chip {
  border: 1.5px solid var(--line); background: transparent; border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 500; color: var(--ink-soft);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.pipe { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.pipe li {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft);
}
.pipe li .dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 11px; color: #fff; flex: none;
}
.pipe li.doing .dot { border-color: var(--accent); animation: pulse 0.9s ease infinite; }
.pipe li.done { color: var(--ink); }
.pipe li.done .dot { background: var(--accent); border-color: var(--accent); }
.pipe li.done .dot::before { content: "✓"; }
@keyframes pulse { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .pipe li.doing .dot { animation: none; } }

.drop {
  border: 2px dashed var(--line); border-radius: var(--r-card); padding: 26px 16px;
  text-align: center; color: var(--ink-soft); font-size: 14px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-tint); }
.drop b { color: var(--ink); }
.mosaic-preview { margin-top: 14px; }
.mosaic-preview canvas { width: 100%; image-rendering: pixelated; border-radius: 8px; border: 1px solid var(--line); }

.viewport { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.viewport canvas { width: 100%; height: 560px; display: block; cursor: grab; }
.viewport canvas:active { cursor: grabbing; }
.vp-empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--ink-soft); font-size: 15.5px; padding: 24px; pointer-events: none;
}
.vp-empty .glyph { font-size: 40px; display: block; margin-bottom: 10px; color: var(--accent); font-weight: 800; }
.vp-badge {
  position: absolute; top: 14px; left: 14px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-family: var(--mono);
}
.vp-tools {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(251, 250, 247, 0.92); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 18px; backdrop-filter: blur(8px);
}
.vp-tools label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.vp-tools input[type="range"] { flex: 1; accent-color: var(--accent); }
.vp-tools .layer-out { font-family: var(--mono); font-size: 13px; min-width: 64px; text-align: right; }

.bom-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.bom-title { font-size: 17px; font-weight: 700; }
.bom-price { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--accent); }
.bom-sub { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 14px; }
.bom-rows { display: flex; flex-direction: column; margin-bottom: 16px; max-height: 300px; overflow-y: auto; }
.bom-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.bom-row + .bom-row { border-top: 1px solid var(--line); }
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,0.12); flex: none; }
.bom-row .cname { flex: 1; }
.bom-row .ccount { font-family: var(--mono); color: var(--ink-soft); }
.bom-actions { display: flex; flex-direction: column; gap: 10px; }
.bom-empty { color: var(--ink-soft); font-size: 14px; padding: 8px 0 4px; }

dialog {
  margin: auto; /* the * reset removes the UA centering */
  border: none; border-radius: var(--r-card); padding: 0; max-width: 480px; width: calc(100% - 48px);
  box-shadow: 0 24px 80px rgba(40, 25, 15, 0.25);
}
dialog::backdrop { background: rgba(30, 22, 16, 0.45); }
.order-body { padding: 28px; }
.order-body h3 { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.order-body .order-sub { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 18px; }
.order-list { list-style: none; margin-bottom: 18px; }
.order-list li { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.order-list li span:last-child { font-family: var(--mono); color: var(--ink-soft); }
.order-note {
  background: var(--accent-tint); border-radius: var(--r-input); padding: 12px 14px;
  font-size: 13.5px; color: var(--ink-soft); margin-bottom: 18px;
}
.order-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------------------------------------------------- community */

.comm-hero { padding: 56px 0 36px; }
.comm-hero h1 { font-size: clamp(32px, 4vw, 46px); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 10px; }
.comm-hero p { color: var(--ink-soft); font-size: 17.5px; max-width: 56ch; margin-bottom: 22px; }
.comm-hero .search { max-width: 420px; }
.featured {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
}
.featured .thumb { background: radial-gradient(circle at 50% 40%, #F4F0E8, #E9E4D8); display: grid; place-items: center; min-height: 380px; }
.featured .thumb img { width: 82%; }
.featured .body { padding: 40px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; }
.featured .body h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.featured .body p { color: var(--ink-soft); font-size: 15.5px; }
.featured .fstats { display: flex; gap: 26px; margin: 6px 0 8px; }
.featured .fstats b { display: block; font-family: var(--mono); font-size: 21px; }
.featured .fstats span { font-size: 13px; color: var(--ink-soft); }

.threads { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.thread { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 16px 22px; text-decoration: none; }
.thread + .thread { border-top: 1px solid var(--line); }
.thread:hover { background: var(--accent-tint); }
.thread b { font-size: 15.5px; font-weight: 600; }
.thread .who { display: block; font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
.thread .replies { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.thread .when { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1020px) {
  .bench { grid-template-columns: 1fr; }
  .viewport canvas { height: 440px; }
  .bento { grid-template-columns: 1fr; grid-template-rows: 340px 220px 220px; }
  .cell-photo { grid-row: auto; }
}
@media (max-width: 860px) {
  .hero-grid, .split, .featured { grid-template-columns: 1fr; }
  .hero-stage canvas { height: 360px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 26px 20px; }
  .band-cols { grid-template-columns: 1fr; gap: 26px; }
  .model-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .section { padding: 60px 0; }
  .hero { padding: 40px 0 24px; }
  .model-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .thread { grid-template-columns: 1fr auto; }
  .thread .when { display: none; }
}
