/* Visual language measured from Shutterfly, Snapfish and Mixtiles (docs/DESIGN-RESEARCH.md):
   white page with a warm tinted surface, deep tinted-dark text, one saturated accent, bold geometric sans,
   8-12 px controls, 12-20 px tiles, pill chips, 24 px grid gaps, content width about 1280 px. */
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap;
  src: url(/fonts/figtree-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap;
  src: url(/fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* light-dark() picks the first value in light mode, the second in dark mode. color-scheme follows the device;
     the theme toggle sets data-theme to force one. */
  color-scheme: light dark;
  --wall: light-dark(#ffffff, #0d1320);        /* page */
  --surface: light-dark(#f5f3f0, #161e30);     /* tiles, stage, footer */
  --canvas: light-dark(#ffffff, #121a2a);      /* cards, inputs */
  --ink: light-dark(#0f1b2d, #eef1f7);
  --muted: light-dark(#5b6475, #a2abbd);
  --line: light-dark(#e6e3df, #263047);
  --control: light-dark(#7d838e, #6f7a93);     /* borders of inputs: at least 3:1 against page and surface */
  --accent: light-dark(#2f4bff, #8ea2ff);
  --on-accent: light-dark(#ffffff, #0d1320);
  --error: light-dark(#c62828, #ff9a91);
  --edge: light-dark(#d9d6d1, #26304a);        /* canvas side edge */
  --shadow: light-dark(rgba(15, 27, 45, .30), rgba(0, 0, 0, .55));
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 3vw, 1.5rem);          /* 24 px like the references */
  --max: 80rem;                                /* 1280 px */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: .2em; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; margin: 0; line-height: 1.08; letter-spacing: -.02em; }
h3 { font-weight: 600; font-size: 1.375rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Content column: centred, at most 80rem wide, 24 px gutters. Full-width backgrounds keep the padding trick. */
header.site, main, footer.site { padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); }
header.site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 2rem; padding-block: .875rem; border-bottom: 1px solid var(--line); }
.brand { font: 800 1.5rem/1 var(--sans); letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
nav.site { display: flex; align-items: center; gap: 1.5rem; }
nav.site a { color: var(--ink); text-decoration: none; font-weight: 500; padding: .5rem 0; }
nav.site a:hover { text-decoration: underline; text-underline-offset: .3em; }
#theme-toggle { font: 500 .9375rem var(--sans); color: var(--ink); background: none; border: 1px solid var(--control); border-radius: 999px; padding: .3rem .9rem; cursor: pointer; }
#theme-toggle:hover { border-color: var(--ink); }
main { padding-block: 0 1rem; }
footer.site { margin-top: 5rem; padding-block: 2rem; background: var(--surface); color: var(--muted); font-size: .9375rem; }
footer.site p { margin: 0 0 .25rem; }
.legal-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: .75rem; }
.legal-links a { color: var(--ink); }

.page-title { font-size: clamp(2rem, 4.5vw, 2.75rem); padding: clamp(1.25rem, 4vw, 2.5rem) 0 1rem; }
.section { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.meta { color: var(--muted); font-size: .9375rem; margin: 0; }
.lead { font-size: 1.125rem; color: var(--muted); }

/* Buttons: 52 px high, 10 px radius, bold label (Mixtiles "Start Creating") */
.btn, button#buy { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: .75rem 1.5rem; font: 700 1.0625rem var(--sans);
  color: var(--on-accent); background: var(--accent); border: 0; border-radius: 10px; text-decoration: none; cursor: pointer; }
.btn:hover, button#buy:hover { filter: brightness(1.08); }
button#buy { width: 100%; }
button#buy:disabled { opacity: .55; cursor: progress; }
.btn.alt { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.linklike, .del button { font: inherit; color: var(--accent); background: none; border: 0; padding: .25rem 0; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }

/* Home hero: rounded banner with a wall scene (Snapfish banner, Mixtiles headline scale) */
.hero { display: grid; margin-top: 1.5rem; overflow: hidden; border-radius: var(--radius-lg); background: #1d2b4a; color: #fff; }
@media (min-width: 52rem) { .hero { grid-template-columns: 1fr 1.1fr; min-height: 24rem; } }
.hero-copy { display: grid; align-content: center; gap: 1.25rem; padding: clamp(2rem, 5vw, 4rem); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1.03; }
.hero p { margin: 0; font-size: 1.1875rem; color: rgb(255 255 255 / .82); max-width: 30rem; }
.hero .btn { background: #fff; color: #0f1b2d; }
.hero .btn.alt { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.hero-scene { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(.5rem, 2vw, 1.25rem);
  min-height: 15rem; padding: 2rem 1.5rem 6.5rem; background: linear-gradient(180deg, #2b3d66 0%, #3a4f7e 100%); }
.hero-scene::before { content: ""; position: absolute; inset: auto 0 0; height: 22%; background: #151f38; }          /* floor */
.hero-scene::after { content: ""; position: absolute; left: 50%; bottom: 10%; width: 62%; height: 20%; transform: translateX(-50%);  /* sofa */
  background: #8793b8; border-radius: 18px 18px 6px 6px; box-shadow: inset 0 -10px 0 rgb(0 0 0 / .12); }
.hang { position: relative; z-index: 1; height: auto; box-shadow: 3px 3px 0 var(--edge), 0 14px 26px -6px rgb(0 0 0 / .55); }
.hang:nth-child(1) { width: 23%; }
.hang:nth-child(2) { width: 32%; margin-top: -1.5rem; }
.hang:nth-child(3) { width: 25%; margin-top: 1rem; }

.chips { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a { display: inline-block; padding: .45rem 1rem; color: var(--ink); text-decoration: none; font-weight: 500; background: var(--surface); border-radius: 999px; }
.chips a:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.chips a[aria-current] { background: var(--accent); color: var(--on-accent); }
.home-chips { margin-top: 2rem; }
.search { display: flex; gap: .5rem; max-width: 30rem; margin-bottom: 1rem; }
.search input, .custom-fields input, .stack input[type="email"] { min-height: 2.75rem; padding: 0 .875rem; font: 1rem var(--sans); color: var(--ink); background: var(--canvas); border: 1px solid var(--control); border-radius: 10px; }
.search input { flex: 1; min-width: 0; }
.search button { min-height: 2.75rem; padding: 0 1.25rem; font: 700 1rem var(--sans); color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: 10px; cursor: pointer; }
.search + .chips + .chips + .meta, .chips + .chips + .meta { margin: 1rem 0 1.25rem; }
.empty { max-width: 32rem; padding: 2rem 0; }
.more { margin: 2rem 0 0; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }

/* Product grid: 2 columns on phones, 3 and 4 wider; 24 px gaps; uniform tinted tiles (Shutterfly) */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
@media (min-width: 40rem) { .grid { grid-template-columns: repeat(3, 1fr); gap: 2rem 1.5rem; } }
@media (min-width: 64rem) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { display: grid; gap: .625rem; color: inherit; text-decoration: none; }
.tile { container-type: size; display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 12%; background: var(--surface); border-radius: var(--radius-lg); transition: background-color .2s ease; }
.tile .canvas img { height: auto; }
.tile--landscape .canvas img, .tile--square .canvas img { width: 100cqw; }
.tile--portrait .canvas img { width: auto; height: 100cqh; }
.canvas { display: block; background: var(--edge); box-shadow: 3px 3px 0 var(--edge), 0 12px 24px -8px var(--shadow); transition: transform .2s ease; }
.card:hover .tile, .card:focus-visible .tile { background: color-mix(in srgb, var(--surface) 80%, var(--ink) 6%); }
.card:hover .canvas, .card:focus-visible .canvas { transform: translateY(-3px); }
.tile.blank { background: transparent; border: 2px dashed var(--control); }
.blank-mark { font: 300 4rem/1 var(--sans); color: var(--muted); }
.card:hover .tile.blank, .card:focus-visible .tile.blank { border-color: var(--accent); background: transparent; }
.card .title { font: 600 1.0625rem/1.25 var(--sans); }

.how { margin: 5rem 0 0; }
.how h2 { font-size: clamp(1.75rem, 4vw, 2.625rem); margin-bottom: 1.5rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; counter-reset: step; }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.steps li { display: grid; gap: .5rem; align-content: start; padding: 1.5rem; background: var(--surface); border-radius: var(--radius-lg); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.5rem; height: 2.5rem; font: 700 1.125rem var(--sans); color: var(--on-accent); background: var(--accent); border-radius: 50%; }
.steps strong { font: 700 1.375rem/1.2 var(--sans); letter-spacing: -.01em; }
.steps span { color: var(--muted); }

/* Product page: media on the left in a tinted stage, details on the right, 50 px apart (Mixtiles) */
.detail { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 52rem) { .detail { grid-template-columns: minmax(0, 1.1fr) minmax(20rem, 1fr); gap: 3.125rem; align-items: start; } .info { position: sticky; top: 1.5rem; } }
.stage { display: grid; gap: .75rem; padding: clamp(1rem, 4vw, 2rem); background: var(--surface); border-radius: var(--radius-lg); }
.cropper img { box-shadow: 4px 4px 0 var(--edge), 0 14px 28px -8px var(--shadow); background: var(--edge); }
.cropper:not(.active) img { width: 100%; height: auto; }
.cropper.active { position: relative; overflow: hidden; touch-action: none; cursor: grab; background: var(--edge); box-shadow: 4px 4px 0 var(--edge), 0 14px 28px -8px var(--shadow); }
.cropper.active.dragging { cursor: grabbing; }
.cropper.active img { position: absolute; max-width: none; height: auto; box-shadow: none; user-select: none; }
.zoom { display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: center; color: var(--muted); }
.zoom input { width: 100%; accent-color: var(--accent); }
#quality[data-level="low"] { color: var(--error); }
.info h1 { font-size: clamp(2rem, 4.5vw, 2.5rem); margin-bottom: .25rem; }
fieldset { border: 0; padding: 0; margin: 1.5rem 0; display: grid; gap: .5rem; }
legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.option { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; padding: .875rem 1rem;
  background: var(--canvas); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.option span:last-child { font-weight: 700; }
.option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--canvas)); }
.option input { accent-color: var(--accent); width: 1.125rem; height: 1.125rem; }
.badge { font-style: normal; font-size: .75rem; font-weight: 700; padding: .125rem .55rem; margin-left: .4rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); vertical-align: middle; }
.custom-details { border: 1.5px solid var(--line); border-radius: 12px; padding: .875rem 1rem; background: var(--canvas); }
.custom-details summary { cursor: pointer; font-weight: 600; }
.custom-details[open] summary { margin-bottom: .75rem; }
.custom-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.custom-fields label { display: grid; gap: .25rem; font-size: .9375rem; color: var(--muted); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 1.5rem 0 1rem; }
.total span { font-weight: 600; }
.total output { font: 800 2.25rem/1 var(--sans); letter-spacing: -.02em; }
.facts { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .25rem; color: var(--muted); font-size: .9375rem; }
.facts li::before { content: "\2713\00a0"; color: var(--accent); font-weight: 700; }
#buy-error, #upload-error, .error { color: var(--error); margin: 0; }
@media (max-width: 51.99rem) {
  /* price and button stay in reach while the long option list scrolls by */
  .buybar { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(var(--gutter) * -1); padding: .5rem var(--gutter) .75rem; background: var(--wall); border-top: 1px solid var(--line); }
  .buybar .total { margin: 0 0 .5rem; }
  .buybar .total output { font-size: 1.75rem; }
}

.upload { max-width: 40rem; }
.upload .lead { margin: 0 0 1.5rem; }
.drop { display: grid; gap: .5rem; place-items: center; text-align: center; padding: 3.5rem 1.5rem; cursor: pointer; background: var(--surface); border: 2px dashed var(--control); border-radius: var(--radius-lg); }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); }
.drop-main { font: 700 1.5rem/1.2 var(--sans); letter-spacing: -.01em; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.auth { max-width: 28rem; }
.auth .lead { margin: 0 0 1.5rem; }
.stack { display: grid; gap: 1rem; }
.stack label { display: grid; gap: .25rem; font-weight: 600; }
button.btn { border: 0; }
.own { display: grid; gap: .5rem; }

.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; max-width: 48rem; }
.line { display: grid; grid-template-columns: 6rem 1fr auto; gap: .5rem 1rem; align-items: center; padding: 1rem; background: var(--canvas); border: 1.5px solid var(--line); border-radius: var(--radius); }
.line.gone { grid-template-columns: 1fr auto; }
.thumb { width: 6rem; height: 6rem; overflow: hidden; border-radius: 8px; background: var(--surface); box-shadow: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.what { display: grid; gap: .1rem; }
.what .name { font: 700 1.125rem/1.25 var(--sans); }
.qty { display: flex; gap: .5rem; align-items: center; }
.qty select { min-height: 2.5rem; padding: 0 .5rem; font: inherit; color: var(--ink); background: var(--wall); border: 1px solid var(--control); border-radius: var(--radius-sm); }
.sum { font: 800 1.25rem/1 var(--sans); text-align: right; }
.line > form:last-child { grid-column: 1 / -1; justify-self: end; }
@media (min-width: 40rem) { .line { grid-template-columns: 6rem 1fr auto auto auto; } .line > form:last-child { grid-column: auto; } }
.summary { max-width: 48rem; margin-top: 1.5rem; display: grid; gap: .75rem; }

.legal { max-width: 44rem; }
.legal h2 { font-size: 1.5rem; margin: 2rem 0 .5rem; }
.legal p, .legal li { max-width: 40rem; }
.legal ul { padding-left: 1.25rem; }
.notice { padding: .75rem 1rem; background: var(--surface); border-left: 3px solid var(--error); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 1.5rem; }
.orders { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .75rem; max-width: 40rem; }
.order { padding: 1rem; background: var(--canvas); border: 1.5px solid var(--line); border-radius: var(--radius); }
.order p { margin: 0 0 .25rem; }
.order ul { margin: 0 0 .5rem; padding-left: 1.25rem; }
.narrow-text { max-width: 38rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
