/* Mobila Direct · foundations: colours, type, buttons, form fields, how things appear.
   The palette comes from the logo (its sky blue) and from the furniture itself
   (brass legs, porcelain tops, the pale gray of the shop's photo studio). */

@property --tint { syntax: '<color>'; inherits: true; initial-value: #dfe8f4; }
@property --hue { syntax: '<color>'; inherits: true; initial-value: #67a0de; }

:root {
  --ink: #0c1424;
  --ink-2: #1d2942;
  --text: #414d66;
  --muted: #71809a;
  --line: #dde4ee;
  --line-2: #c9d3e2;
  --paper: #f2f4f9;
  --white: #fff;
  --mist: #e6ecf5;
  --wall: #e6e8ee;          /* the studio wall in the opening photo */

  --blue: #67a0de;          /* the logo */
  --sky: #9ccbf7;
  --azure: #4a8fe6;
  --cobalt: #2f63d6;
  --navy: #132a63;
  --brass: #c8a25a;
  --brass-l: #f1ddab;
  --brass-d: #8f6a2a;
  --sale: #c2552e;

  --g-brand: linear-gradient(120deg, #8fc4fa 0%, #67a0de 34%, #3f76d2 70%, #2b4fb5 100%);
  --g-brand-soft: linear-gradient(135deg, #e3f0ff 0%, #cfe3fb 50%, #dfe6fb 100%);
  --g-brass: linear-gradient(120deg, #f4e3b5 0%, #d2ad66 48%, #a37a36 100%);
  --g-night: radial-gradient(110% 130% at 85% -10%, #24489c 0%, #122250 42%, #0a1126 100%);
  --g-text: linear-gradient(100deg, #2f63d6 0%, #5b97e2 45%, #86bcf3 100%);

  --r-xs: 10px;
  --r-s: 14px;
  --r-m: 22px;
  --r-l: 32px;
  --r-xl: 44px;

  --sh-s: 0 1px 2px rgba(19, 42, 99, .06), 0 4px 14px -6px rgba(19, 42, 99, .12);
  --sh-m: 0 2px 4px rgba(19, 42, 99, .05), 0 22px 44px -22px rgba(19, 42, 99, .32);
  --sh-l: 0 4px 8px rgba(19, 42, 99, .05), 0 44px 90px -36px rgba(19, 42, 99, .42);
  --sh-blue: 0 14px 30px -12px rgba(47, 99, 214, .55);

  --ease: cubic-bezier(.22, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);

  --f-display: 'Geologica', 'Onest', system-ui, sans-serif;
  --f-text: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Cormorant', 'Iowan Old Style', Georgia, serif;

  --wrap: 1360px;
  --gut: clamp(18px, 4.2vw, 64px);
  --hd-h: 68px;
}
@media (min-width: 1800px) { :root { --wrap: 1560px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
html.has-layer { overflow: hidden; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--text);
  font: 400 16px/1.6 var(--f-text); font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
@media (min-width: 1800px) { body { font-size: 17px; } }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 6px; }
::selection { background: #cfe3fb; color: var(--ink); }
[hidden] { display: none !important; }
#main { outline: none; min-height: 70vh; }
#main.is-leaving { opacity: 0; transition: opacity .16s ease; }
#main.is-entering { opacity: 0; }
#main { transition: opacity .3s ease; }

.wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; }
.sec { position: relative; padding-block: clamp(72px, 9vw, 150px); }
.sec--tight { padding-block: clamp(48px, 6vw, 96px); }
.ic { width: 1.25em; height: 1.25em; flex: none; }
/* <use> takes its paint from where it is used, so the line style lives here and not in the sprite */
.ic, .mq__dot, .floater svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.floater svg { stroke-width: 2.6; }

/* ------------------------------------------------------------------ type */
.h1, .h2, .h3 { font-family: var(--f-display); color: var(--ink); font-weight: 650; letter-spacing: -.035em; line-height: 1.02; text-wrap: balance; }
.h1 { font-size: clamp(2.5rem, 6.3vw, 6.2rem); }
.h2 { font-size: clamp(2rem, 4.3vw, 4.1rem); }
.h3 { font-size: clamp(1.35rem, 2vw, 1.9rem); letter-spacing: -.025em; line-height: 1.12; }
/* the accent words: a serif italic in the brand gradient. When a heading is split into words for
   its entrance, each word carries the gradient itself (a clipped background does not show through
   the moving word boxes). */
.h1 em, .h2 em, .h3 em, .em { font-family: var(--f-serif); font-style: italic; font-weight: 500; letter-spacing: -.02em; font-size: 1.13em; line-height: .9; color: var(--cobalt); }
:is(.h1, .h2, .h3) em:not(:has(.wi)), .em, :is(.h1, .h2, .h3) em .wi {
  background: var(--g-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-inline: .04em .12em; margin-inline: -.04em -.12em;
}
.on-night :is(.h1, .h2, .h3) em:not(:has(.wi)), .on-night :is(.h1, .h2, .h3) em .wi { background-image: linear-gradient(100deg, #f4e3b5, #e3c27f 50%, #f7ecd0); }
.lead { font-size: clamp(1.02rem, 1.25vw, 1.25rem); line-height: 1.6; color: var(--text); max-width: 56ch; text-wrap: pretty; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; font: 600 .74rem/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--cobalt);
}
.eyebrow::before { content: ''; width: 26px; height: 2px; border-radius: 2px; background: var(--g-brand); }
.on-night { color: #c4cfe6; }
.on-night .h1, .on-night .h2, .on-night .h3 { color: #fff; }
.on-night .eyebrow { color: var(--brass-l); }
.on-night .eyebrow::before { background: var(--g-brass); }
.on-night .lead { color: #b9c5de; }
.num { font-variant-numeric: tabular-nums; }

.sec__head { display: grid; gap: 18px; margin-bottom: clamp(32px, 4.5vw, 68px); }
.sec__head > div:first-child { display: grid; gap: 16px; justify-items: start; }
.sec__head--center > div:first-child { justify-items: center; }
.sec__head--split { grid-template-columns: 1fr; align-items: end; }
@media (min-width: 900px) { .sec__head--split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; } }
.sec__head--center { justify-items: center; text-align: center; }
.sec__head--center .lead { margin-inline: auto; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --bg: var(--ink); --fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; isolation: isolate;
  min-height: 54px; padding: 0 26px; border-radius: 999px; background: var(--bg); color: var(--fg);
  font: 600 .98rem/1 var(--f-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), background-color .3s;
}
.btn::after {   /* a sheen that crosses the button on hover */
  content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .42) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .9s var(--ease-out);
}
.btn .ic { transition: transform .5s var(--ease-out); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn:hover::after { transform: translateX(120%); }
  .btn:hover .ic--go { transform: translateX(4px); }
}
.btn:active { transform: translateY(0) scale(.98); }
.btn--brand { background: var(--g-brand); background-size: 160% 100%; box-shadow: var(--sh-blue); }
.btn--brass { background: var(--g-brass); color: #2a1e08; box-shadow: 0 14px 30px -14px rgba(163, 122, 54, .7); }
.btn--ghost { background: rgba(255, 255, 255, .6); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn--ghost:hover { background: #fff; }
.btn--glass { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.link { display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem/1.2 var(--f-display); color: var(--cobalt); }
.link .ic { transition: transform .45s var(--ease-out); }
.link:hover .ic { transform: translate(3px, -3px); }
.link--line { background: linear-gradient(currentColor, currentColor) 0 100%/0 1.5px no-repeat; transition: background-size .5s var(--ease-out); padding-bottom: 3px; }
.link--line:hover { background-size: 100% 1.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line); font: 500 .86rem/1 var(--f-text); color: var(--ink-2); white-space: nowrap;
}
.chip .ic { color: var(--cobalt); }
.badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font: 700 .74rem/1 var(--f-display); letter-spacing: .02em;
  background: var(--g-brass); color: #2a1e08;
}

/* swatch: a dot of the product's own colour */
.sw {
  --c: #999; position: relative; width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(12, 20, 36, .16), inset 0 -6px 8px -4px rgba(0, 0, 0, .22), inset 0 5px 6px -4px rgba(255, 255, 255, .55);
  transition: transform .4s var(--ease-out);
}
.sw::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--cobalt); opacity: 0; transform: scale(.8); transition: opacity .3s, transform .4s var(--ease-out); }
.sw.is-on::after, .sw[aria-pressed='true']::after, .sw[aria-checked='true']::after { opacity: 1; transform: none; }
.sw:hover { transform: scale(1.12); }
.sw--sm { width: 18px; height: 18px; }
.sw--sm::after { inset: -4px; }

/* ------------------------------------------------------------------ fields */
.field { display: grid; gap: 8px; }
.field > span { font: 600 .82rem/1 var(--f-display); color: var(--ink-2); letter-spacing: .01em; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 54px; padding: 14px 18px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  transition: border-color .25s, box-shadow .25s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--azure); box-shadow: 0 0 0 4px rgba(74, 143, 230, .18); }
.field.is-bad input, .field.is-bad textarea { border-color: var(--sale); box-shadow: 0 0 0 4px rgba(194, 85, 46, .12); }
.field__err { font-size: .82rem; color: var(--sale); }
.field__err:empty { display: none; }
.note {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-s); background: #fff8e8; color: #5d4513;
  box-shadow: inset 0 0 0 1px #ecd9a8; font-size: .9rem; line-height: 1.5;
}
.note .ic { color: var(--brass-d); margin-top: 2px; }

.qty { display: inline-grid; grid-template-columns: 44px 44px 44px; align-items: center; height: 54px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.qty button { height: 100%; display: grid; place-items: center; color: var(--ink); border-radius: 999px; transition: background-color .2s; }
.qty button:hover { background: var(--mist); }
.qty output { text-align: center; font: 600 1rem/1 var(--f-display); color: var(--ink); }
.qty--sm { grid-template-columns: 34px 30px 34px; height: 40px; }

/* ------------------------------------------------------------------ how things appear
   data-rv="up|fade|scale|left|right|clip|pop" ; nothing shows before the loading screen opens */
[data-rv] { --d: 0ms; transition: opacity .9s var(--ease-out) var(--d), transform 1.1s var(--ease-out) var(--d), clip-path 1.2s var(--ease-io) var(--d), filter .9s ease var(--d); }
[data-rv='up'] { opacity: 0; transform: translateY(42px); }
[data-rv='fade'] { opacity: 0; }
[data-rv='scale'] { opacity: 0; transform: scale(.92); }
[data-rv='left'] { opacity: 0; transform: translateX(-48px); }
[data-rv='right'] { opacity: 0; transform: translateX(48px); }
[data-rv='pop'] { opacity: 0; transform: translateY(26px) scale(.9); filter: blur(6px); }
[data-rv='clip'] { clip-path: inset(0 0 100% 0 round var(--r-l)); transform: scale(1.04); }
[data-rv].is-in { opacity: 1; transform: none; filter: none; }
[data-rv='clip'].is-in { clip-path: inset(0 0 0 0 round var(--r-l)); }
/* headings rise word by word */
[data-split] .w { display: inline-block; overflow: clip; overflow-clip-margin: .14em; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
[data-split] .wi { display: inline-block; transform: translateY(108%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.05s var(--ease-out) calc(var(--i) * 42ms); }
[data-split].is-in .wi { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  [data-rv], [data-split] .wi { opacity: 1 !important; transform: none !important; clip-path: none !important; filter: none !important; }
}

/* page change */
::view-transition-old(root) { animation: vt-out .28s ease both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
