/* Ryleve Art — design tokens taken from ryleve.com: white canvas, DM Sans, warm terracotta
   brand colour, soft beige accents and green sale prices. */
@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-garamond-latin-600-italic.woff2') format('woff2'); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'Great Vibes'; src: url('/fonts/great-vibes-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --brand: #b07050;
  --brand-soft: #bf917a;
  --sale: #31ac74;
  --sale-bg: #e9f8f0;
  --ink: #111;
  --muted: #6b6b6b;
  --line: #ececec;
  --tint: #f6f6f6;
  --radius: 10px;
  --wrap: 1200px;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: #fff; line-height: 1.55; border-top: 4px solid var(--brand-soft); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
code { font-family: ui-monospace, 'IBM Plex Mono', Menlo, monospace; font-size: .9em; background: var(--tint); padding: .1em .35em; border-radius: 4px; }
main { max-width: var(--wrap); margin: 0 auto; padding: 0 20px 64px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
[hidden] { display: none !important; }

/* header / footer */
.site-header { max-width: var(--wrap); margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.brand strong { display: block; color: var(--brand); font-size: 1.15rem; }
.brand small { display: block; color: var(--muted); font-size: .95rem; }
.brand-sm { gap: 10px; }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.site-nav a { text-decoration: none; font-size: .98rem; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { border-color: var(--brand-soft); }
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 20px 40px; font-size: .92rem; }
.footer-inner p { margin: .5em 0 0; }

/* hero */
.hero { text-align: center; padding: 48px 0 28px; max-width: 720px; margin: 0 auto; }
.hero-logo { margin: 0 auto 18px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 600; }
.hero p { color: var(--muted); font-size: 1.05rem; }
.hero-sm { padding: 36px 0 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--brand); font-weight: 600; margin: 0 0 .6em; }
.section-title { font-size: 1.35rem; font-weight: 600; margin: 36px 0 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .98rem; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s; }
.btn:hover { background: #9a5f42; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-ghost:hover { background: #fbf4f0; }
.btn-sm { padding: 7px 14px; font-size: .88rem; }
.btn-buy { width: 100%; padding: 15px 22px; font-size: 1.05rem; margin: 18px 0 8px; }
:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid, .grid-2 { grid-template-columns: 1fr 1fr; gap: 22px 12px; } }
.product-card { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.product-img { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--tint); }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-img img { transform: scale(1.03); }
.product-title { font-size: .92rem; color: #333; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: inline-flex; align-items: baseline; gap: 8px; }
.price-now { color: var(--sale); font-weight: 700; font-size: 1.15rem; }
.price-was { color: var(--muted); font-size: .85rem; }
.product-info .price-now { font-size: 2rem; }
.product-info .price-was { font-size: 1.05rem; }

/* personalised feature */
.feature { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: center; background: #fbf6f2; border-radius: 18px; padding: 36px; margin: 18px 0 8px; }
.feature h2 { font-size: 1.9rem; font-family: var(--serif); font-weight: 600; }
.feature p { color: #4a4a4a; }
@media (max-width: 800px) { .feature { grid-template-columns: 1fr; padding: 24px; } }

/* product page */
.product { display: grid; grid-template-columns: 1.6fr 1fr; gap: 44px; padding-top: 32px; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 24px; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--tint); }
.gallery-main img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; flex: 0 0 auto; }
.gallery-thumbs button[aria-current] { border-color: var(--brand-soft); }
.gallery-thumbs img { width: 84px; height: 84px; object-fit: cover; }
.crumbs { margin: 0 0 6px; }
.crumbs a { text-decoration: underline; text-underline-offset: 3px; }
.product-info h1 { font-size: 1.05rem; font-weight: 700; margin-top: 14px; }
.small-title { font-size: 1rem; font-weight: 700; margin-top: 22px; }
.checks, .notes { list-style: none; padding: 0; margin: 10px 0; }
.checks li { padding-left: 32px; position: relative; margin: 8px 0; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border: 1.5px solid var(--brand-soft); border-radius: 50%; color: var(--brand); font-size: .75rem; display: grid; place-items: center; }
.notes li { padding-left: 30px; position: relative; margin: 10px 0; font-size: .9rem; color: #333; }
.notes li::before { content: 'i'; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border: 1.5px solid var(--brand-soft); border-radius: 50%; color: var(--brand); font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.rule { border: 0; border-top: 2px solid var(--brand-soft); width: 100px; margin: 16px 0; }
.description { max-width: 760px; margin: 48px 0 0; border-top: 1px solid var(--line); padding-top: 28px; }
.description h2 { font-size: 1.25rem; }
.description h3 { font-size: 1rem; margin-top: 1.4em; }

/* editor */
.editor { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding-top: 28px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.editor-preview { position: sticky; top: 16px; }
@media (max-width: 900px) { .editor-preview { position: static; } }
.editor-form h1 { font-size: 1.5rem; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field > span { font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; }
.field small { color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input[type=search], input[type=number], input[type=url], input:not([type]), textarea, select {
  font: inherit; font-size: 1rem; padding: 11px 13px; border: 1px solid #d9d4cf; border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { border-color: var(--brand-soft); outline: 2px solid #f0e2da; }
.swatches { border: 0; padding: 0; margin: 16px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.swatches legend { font-weight: 600; font-size: .92rem; margin-bottom: 8px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .9rem; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch-dot { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.swatch:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--brand-soft); }
.form-error { color: #b3261e; background: #fdecea; padding: 10px 12px; border-radius: 8px; font-size: .92rem; }
.notice { background: #fff6e5; border: 1px solid #f3dfb5; padding: 12px 14px; border-radius: 8px; }

/* 3D stage */
.viewer-stage { width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #e9e4de; position: relative; }
.viewer-stage canvas { width: 100% !important; height: 100% !important; display: block; cursor: grab; }
.viewer-stage canvas:active { cursor: grabbing; }
.stage-error { display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.viewer-hint { text-align: center; color: var(--muted); font-size: .88rem; margin: 10px 0 0; }

/* full-screen viewer for a personalised link */
.viewer-body { border-top: 0; background: #1b1b1b; color: #f3eee6; }
.viewer-body main { max-width: none; padding: 0; }
.viewer { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.viewer .viewer-stage { width: min(100%, 1100px); max-height: 78vh; aspect-ratio: 4 / 3; }
.viewer .viewer-hint { color: #bdb6ad; }
.viewer-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.viewer .btn-ghost { background: transparent; color: #f3eee6; border-color: #8a7d72; }
.viewer-credit { font-size: .8rem; color: #a99f95; text-decoration: none; margin-top: 4px; }
.viewer-credit:hover { color: #fff; }
.viewer-banner { background: #3a302a; color: #f3e6dc; padding: 8px 14px; border-radius: 999px; font-size: .88rem; margin: 0; }
.viewer-banner a { color: #fff; }

/* thanks / manage */
.thanks, .manage, .empty { max-width: 680px; margin: 0 auto; padding: 48px 0; }
.thanks h1, .manage h1, .empty h1 { font-size: 2rem; font-family: var(--serif); font-weight: 600; }
.link-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-box code { font-size: 1rem; padding: 10px 12px; word-break: break-all; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.panel { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin: 18px 0; background: #fff; }
.panel h2 { font-size: 1.05rem; }
.radio { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.radio input { margin-top: 5px; accent-color: var(--brand); }
.manage-link { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }

.how ol { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0 0; }
@media (max-width: 760px) { .how ol { grid-template-columns: 1fr; } }
.how li { counter-increment: s; background: var(--tint); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.how li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.how span { color: #555; font-size: .94rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* photo upload + cropper */
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-row img { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.cropper { border: 0; border-radius: 16px; padding: 22px; width: min(94vw, 520px); }
.cropper::backdrop { background: rgba(20, 14, 10, .6); }
.cropper h2 { font-size: 1.2rem; margin-bottom: 4px; }
.crop-frame { margin: 12px auto; width: min(100%, 360px); aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.crop-frame canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.crop-zoom { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: .9rem; }
.crop-zoom input { flex: 1; accent-color: var(--brand); }

/* search + home shelves */
.search input { width: 190px; padding: 8px 14px; border-radius: 999px; font-size: .92rem; }
@media (max-width: 760px) { .search { width: 100%; } .search input { width: 100%; } }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.shelf-head a { color: var(--brand); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.shelf + .shelf { margin-top: 18px; }
.description p { white-space: normal; }
