@font-face { font-family: "Bodoni Moda"; src: url(fonts/bodoni-moda.woff2); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(fonts/figtree.woff2); font-weight: 400 700; font-display: swap; }

/* Colours and fonts. To try another title font, change --title. */
:root {
  color-scheme: light;
  --page: #fff; --ink: #000; --soft: #ebe9e7; --hero: #e6e3e1; --hero-ink: #000;
  --button: #000; --button-ink: #fff; --cloth: #efe9df; --coat: #d8d0c5;
  --title: "Bodoni Moda", Didot, "Times New Roman", serif; --text: "Figtree", system-ui, sans-serif;
  --edge: max(4vw, 1rem);
}
* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--page); color: var(--ink); font: 1rem/1.5 var(--text); overflow-x: clip; }
h1, h2 { font-family: var(--title); font-weight: 400; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
#list h1:focus { outline: 0; }
[hidden] { display: none !important; }

.button { display: inline-block; background: var(--button); color: var(--button-ink); padding: .8rem 1.75rem; text-decoration: none; font-weight: 600; }
.pic { display: block; width: 100%; aspect-ratio: 5 / 6; background: var(--soft); }

header { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .5rem var(--edge); background: var(--page); }
header nav, .tools { display: flex; gap: clamp(1rem, 2.2vw, 2rem); }
.tools { justify-content: flex-end; }
header :is(nav a, button) { min-height: 2.75rem; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; font-size: .9375rem; }
header :is(nav a, button):hover { text-decoration: underline; text-underline-offset: .3em; }
.logo { font: 400 clamp(1.375rem, 3vw, 2.25rem)/1 var(--title); letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
h1, h2, .logo { text-transform: uppercase; font-variation-settings: "opsz" 24; }

.hero { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; background: var(--hero); color: var(--hero-ink); min-height: min(38rem, 78vh); overflow: hidden; }
.hero > div { display: grid; gap: 1.5rem; justify-items: start; padding: 3rem 0 3rem calc(var(--edge) + 3vw); z-index: 1; }
.hero p { max-width: 24rem; font-size: 1.125em; }
.hero > svg { position: absolute; right: 4%; bottom: 0; height: 100%; aspect-ratio: 1; max-width: 52%; }

.fabrics { display: flex; justify-content: center; gap: clamp(.5rem, 4.5vw, 4rem); padding: 2.5rem var(--edge) 1rem; }
.fabrics a { display: grid; justify-items: center; gap: .75rem; text-decoration: none; flex: 0 1 7rem; }
.fabrics a:is(:hover, [aria-current]) { text-decoration: underline; text-underline-offset: .3em; }
.swatch { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--soft) center / cover; }
.chiffon { background-image: url(images/chiffon.jpg); }
.jersey { background-image: url(images/jersey.jpg); }
.satin { background-image: url(images/satin.jpg); }
.modal { background-image: url(images/modal.jpg); }
.crepe { background-image: url(images/crepe.jpg); }
.fabrics a[aria-current] .swatch { outline: 2px solid var(--ink); outline-offset: 4px; }

.row { position: relative; padding: 2.5rem var(--edge) 1rem; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; }
.head a { text-underline-offset: .4em; white-space: nowrap; padding: .6rem 0; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * .75rem) / 4); gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip li { scroll-snap-align: start; }
li:nth-child(even) .pic { scale: -1 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 45%), 1fr)); gap: 2rem .75rem; }
li > button[data-product] { display: block; width: 100%; text-align: start; }
li > button b, li > button span, .strip li > span { display: block; }
li > button b { font-weight: 500; margin-top: .75rem; }
li > button:hover b { text-decoration: underline; text-underline-offset: .25em; }
.strip li > span { margin-top: .75rem; }
.next { display: none; position: absolute; right: calc(var(--edge) - .75rem); top: 55%; width: 3rem; height: 3rem; border-radius: 50%; background: var(--page); box-shadow: 0 2px 12px #0003; place-items: center; }
.next svg { width: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.5; }

#list { padding: 3rem var(--edge); min-height: 70vh; }
#list > p { margin-top: 1rem; max-width: 40rem; font-size: 1.125em; }
#list .fabrics { justify-content: flex-start; padding-inline: 0; padding-bottom: 2.5rem; }
#list .fabrics a { flex-basis: 5rem; }

footer { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 3rem; padding: 2.5rem var(--edge); background: var(--soft); }
footer strong { display: block; }
footer small { grid-column: 1 / -1; font-size: .875rem; }

dialog { color: var(--ink); background: var(--page); border: 0; padding: 0; width: min(52rem, 100% - 2rem); max-height: calc(100dvh - 2rem); overflow: auto; }
dialog::backdrop { background: #0008; }
:root:has(dialog[open]) { overflow: hidden; }
.close { position: absolute; top: .5rem; right: .5rem; min-height: 2.75rem; padding: 0 1rem; text-decoration: underline; text-underline-offset: .3em; background: var(--page); z-index: 1; }
#product[open], #signup[open] { display: grid; grid-template-columns: 1fr 1fr; }
dialog > .pic { height: 100%; border-radius: 0; }
dialog form { display: grid; gap: 1rem; align-content: center; justify-items: start; padding: 4rem 2rem 2rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: .25rem; font-weight: 600; }
#colours { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
#colours label { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; cursor: pointer; }
#colours input { position: absolute; opacity: 0; }
#colours i { width: 1.75rem; height: 1.75rem; border-radius: 50%; box-shadow: inset 0 0 0 1px #0003; }
#colours :checked + i { outline: 2px solid var(--ink); outline-offset: 2px; }
#colours :focus-visible + i { outline-width: 4px; }
#signup label { width: 100%; font-weight: 600; }
#signup input { display: block; border-radius: 0; width: 100%; font: inherit; font-weight: 400; color: inherit; background: var(--page); border: 1px solid var(--ink); padding: .7rem .9rem; margin-top: .25rem; }
#bag { width: min(30rem, 100% - 2rem); }
#bag[open] { display: grid; gap: 1.25rem; padding: 1.5rem; }
#bag li { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 1rem; align-items: center; padding: .5rem 0; }
#bag li b { display: block; font-weight: 600; }
#bag li button { min-height: 2.75rem; text-decoration: underline; text-underline-offset: .3em; }
#total { font-weight: 600; }

@media (max-width: 800px) {
  .hero { min-height: 26rem; }
  header { grid-template-columns: 1fr auto; }
  header nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .strip { grid-auto-columns: 44%; }
  .next { display: grid; top: 45%; }
}
@media (max-width: 600px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero > div { gap: 1rem; padding: 2rem var(--edge) 0; }
  .hero > svg { position: static; max-width: none; width: 100%; height: auto; aspect-ratio: 1; }
  .fabrics a { font-size: .875rem; }
  .strip { grid-auto-columns: 62%; }
  footer { grid-template-columns: 1fr; }
  #product[open], #signup[open] { grid-template-columns: 1fr; }
  dialog > .pic { height: auto; aspect-ratio: 3 / 2; }
  dialog form { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
