:root {
  color-scheme: dark;
  --bg: #151313;
  --surface: #201d1d;
  --line: #3c3636;
  --text: #f7f0eb;
  --muted: #bbb0ab;
  --accent: #ff785f;
  --accent-hover: #ff9a84;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.muted { color: var(--muted); line-height: 1.55; }
.shell { width: min(1200px, calc(100% - 72px)); margin: auto; }
.bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar-inner { width: min(1200px, calc(100% - 72px)); min-height: 70px; margin: auto; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 31px; font-weight: 800; letter-spacing: -.08em; white-space: nowrap; }
.brand-mark { display: inline-block; width: 19px; height: 19px; border: 2px solid var(--accent); border-radius: 5px; position: relative; }
.brand-mark::after { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; position: absolute; inset: 0; margin: auto; }
.brand-dot { color: var(--accent); margin-left: -7px; }
.desktop-nav { display: flex; gap: 22px; align-self: stretch; align-items: center; color: var(--muted); }
[aria-current="page"] { color: var(--text); }
.desktop-nav [aria-current="page"] { box-shadow: inset 0 -2px var(--accent); display: flex; height: 100%; align-items: center; }
.account { margin-left: auto; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 9px; background: var(--accent); color: #211310; font-weight: 700; text-align: center; }
.button:hover { background: var(--accent-hover); }
.button:disabled { opacity: .55; cursor: wait; }
.button-subtle { border-color: var(--line); color: var(--text); background: #262222; }
.button-subtle:hover { background: #342c2a; }
.hero { margin-top: 34px; min-height: 370px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 17px; background: #231b1a; }
.hero-copy { align-self: center; position: relative; z-index: 1; padding: 40px clamp(25px, 5vw, 66px); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 15px; }
h1 { font-size: clamp(38px, 6.1vw, 81px); line-height: .99; letter-spacing: -.068em; }
.hero h1 { font-size: clamp(34px, 4.8vw, 68px); }
.hero-copy p:not(.eyebrow) { margin: 20px 0 23px; max-width: 31ch; }
.hero-image { min-width: 0; position: relative; background: radial-gradient(ellipse at 70% 50%, #8a3024, #261918 72%); overflow: hidden; }
.hero-image::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #231b1a 0%, #231b1a00 37%); }
.hero-image .cover { position: absolute; width: 100%; right: 0; top: 50%; transform: translateY(-50%); }
.section { margin-top: 48px; }
.section h2 { font-size: clamp(25px, 4vw, 40px); letter-spacing: -.047em; margin-bottom: 16px; }
.tools { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 10px; }
.tool { min-height: 107px; padding: 17px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-content: space-between; gap: 6px; }
.tool:hover, .template:hover { border-color: var(--accent); }
.tool strong { font-size: 17px; }
.tool small { grid-column: 1/-1; color: var(--muted); line-height: 1.35; }
.arrow { color: var(--accent); }
.catalog-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 13px; color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--text); color: #211b1b; border-color: var(--text); }
.reference-modes { margin-bottom: 23px; }
.reference-modes [aria-current="page"] { background: var(--text); color: #211b1b; border-color: var(--text); }
.field { min-width: 0; width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #181616; color: var(--text); }
.search { width: min(100%, 265px); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.template { overflow: hidden; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; }
.cover { background-color: #382827; background-image: url("/covers.webp"); background-size: 300% 200%; background-repeat: no-repeat; aspect-ratio: 1; }
.art-0 { background-position: 0 0; }
.art-1 { background-position: 50% 0; background-color: #514c49; }
.art-2 { background-position: 100% 0; background-color: #5b4a39; }
.art-3 { background-position: 0 100%; background-color: #3b4331; }
.art-4 { background-position: 50% 100%; background-color: #4b563c; }
.art-5 { background-position: 100% 100%; background-color: #25284c; }
.template-caption { padding: 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.template-caption small { display: block; margin-top: 4px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); margin-top: 50px; padding: 20px 0 35px; color: var(--muted); font-size: 13px; }
.mobile-nav { display: none; }
.page { margin-top: 30px; min-height: 52vh; }
.page h1 { font-size: clamp(34px, 5vw, 62px); margin-bottom: 14px; }
.back { display: inline-block; margin-bottom: 23px; color: var(--muted); }
.back:hover { color: var(--text); }
.workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(20px, 5vw, 65px); align-items: start; }
.workspace figure { margin: 0; }
.workspace .cover { border-radius: 12px; }
.sample-note { margin-top: 10px; font-size: 13px; }
.editor { display: grid; gap: 17px; margin-top: 22px; }
.label { display: grid; gap: 7px; font-weight: 650; }
.label small { font-weight: 400; color: var(--muted); }
.label textarea { min-height: 100px; resize: vertical; }
.upload { padding: 11px 13px; background: var(--surface); border: 1px dashed #6a5553; border-radius: 8px; }
.upload-preview { display: block; width: 92px; max-height: 105px; object-fit: contain; background: #110e0e; border-radius: 5px; }
.upload-preview[hidden], [hidden] { display: none; }
.upload input { max-width: 100%; }
.consent { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.consent[hidden] { display: none; }
.consent input { accent-color: var(--accent); }
.feedback { min-height: 1.3em; color: var(--muted); }
.feedback[data-error="true"] { color: #ff9d8c; }
.login { display: grid; gap: 16px; max-width: 410px; margin-top: 23px; }
.empty { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.empty p { margin-bottom: 12px; }
.gallery-head { margin-bottom: 20px; }
.result { padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; align-content: start; }
.result img { width: 100%; max-height: 500px; object-fit: contain; border-radius: 6px; background: #161313; }
.rating { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--muted); font-size: 13px; }
.rating button { min-width: 32px; min-height: 32px; border-radius: 6px; color: var(--text); border: 1px solid var(--line); background: var(--surface); }
.rating button[aria-pressed="true"] { color: #201713; border-color: var(--accent); background: var(--accent); }
.compare { width: min(960px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.compare::backdrop { background: #0e0b0bd9; }
.compare header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.comparison figure { margin: 0; display: grid; gap: 8px; align-content: start; }
.comparison figcaption { color: var(--muted); font-size: 13px; }
.comparison img { width: 100%; height: min(62dvh, 560px); object-fit: contain; background: var(--bg); border-radius: 8px; }
@media (max-width: 620px) {
  .comparison { grid-template-columns: 1fr; }
  .comparison img { height: min(44dvh, 340px); }
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.result .button { font-size: 14px; }
@media (max-width: 860px) {
  .shell, .bar-inner { width: calc(100% - 40px); }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { gap: 9px; }
}
@media (max-width: 620px) {
  .shell, .bar-inner { width: calc(100% - 28px); }
  .bar-inner { min-height: 56px; }
  .desktop-nav { display: none; }
  .hero { margin-top: 18px; grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 25px 20px; }
  .hero-copy p:not(.eyebrow) { margin: 12px 0 16px; }
  .hero-image { order: -1; height: 215px; }
  .hero-image::before { background: linear-gradient(0deg, #231b1a 0%, #231b1a00 39%); }
  .section { margin-top: 32px; }
  .grid, .workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 1fr; }
  .workspace > figure { margin: 0; max-width: 300px; }
  .template-caption { padding: 10px; }
  .tool { padding: 12px; min-height: 95px; }
  .tool strong { font-size: 15px; }
  .footer { padding-bottom: 80px; }
  .mobile-nav { position: fixed; z-index: 3; bottom: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); background: #1d1919; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav a { color: var(--muted); font-size: 13px; padding: 15px 5px; text-align: center; }
  .mobile-nav [aria-current="page"] { color: var(--accent); }
}
