/* Layout: an evening exhibition. Each quilt hangs large on a plum wall under a picture light,
   with a soft violet wall label beside it. Gold running-stitch thread is the only ornament. */

@font-face {
  font-family: "Gloock";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/gloock-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --wall: #1A0B2E;        /* plum gallery wall */
  --alcove: #2D1B4E;      /* deeper violet bay for the prints room */
  --gold: #D4AF37;        /* metallic thread */
  --lavender: #B892FF;    /* secondary, quiet accents */
  --cream: #F4F0F8;       /* text on the wall, wall-label card */
  --cream-soft: #D9CFE6;  /* secondary text on the wall, tinted from the plum */
  --ink: #1A0B2E;         /* text on the label and on gold */
  --ink-soft: #4A3866;    /* secondary text on the label */
  --error: #A3241F;       /* invalid field border on cream, 6.5:1 */
  --night: #06020E;       /* shadow base, a near-black plum */
  --shadow: color-mix(in srgb, var(--night) 62%, transparent);
  --display: "Gloock", "Georgia", "Times New Roman", serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Verdana", system-ui, sans-serif;
  --step-small: 1.125rem; /* 18px floor for captions and labels, for older eyes */
  --step-0: 1.15rem;      /* 18.4px body */
  --step-1: 1.35rem;
  --step-label: 1.6rem;   /* wall-label titles, the name mark, step numerals */
  --step-2: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
  --step-3: clamp(2.4rem, 1.6rem + 3.4vw, 4.2rem);
  --step-4: clamp(3rem, 1.8rem + 5.4vw, 5.8rem);
  /* one 16px stitch tile, repeated with round so a line never ends on a half dash */
  --stitch: linear-gradient(90deg, var(--gold) 0 9px, transparent 9px);
  --stitch-ink: linear-gradient(90deg, var(--ink) 0 9px, transparent 9px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 14px;         /* labels and buttons: the soft corner beside the hard-edged quilts */
  --radius-field: 10px;   /* form fields and notices, a step tighter */
  scrollbar-color: color-mix(in srgb, var(--lavender) 45%, var(--wall)) var(--wall);
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--wall); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--cream); font-family: var(--body); font-size: var(--step-0); line-height: 1.6; caret-color: var(--gold); }
::selection { background: var(--gold); color: var(--ink); }
img { max-width: 100%; }
.wrap { max-width: 1240px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); } }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 20; background: var(--gold); color: var(--ink); font-weight: 700; padding: 12px 18px; text-decoration: none; border-radius: var(--radius-field); }
.skip:focus { top: 12px; }

/* Stitched links: the thread runs under the word */
.stitch { display: inline-block; padding-block: 10px 6px; text-decoration: none; background-image: var(--stitch); background-size: 16px 2px; background-repeat: round no-repeat; background-position: 0 100%; transition: color .2s; }
.stitch:hover { color: var(--gold); }

/* Header */
.top { position: relative; z-index: 5; background: var(--wall); border-bottom: 1px solid color-mix(in srgb, var(--cream) 10%, transparent); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 76px; flex-wrap: wrap; padding-block: 10px; }
@media (min-width: 900px) { .top { position: sticky; top: 0; } } /* phones: the header scrolls away instead of covering a third of the screen at large text */
.mark { font-family: var(--display); font-size: var(--step-label); text-decoration: none; color: var(--cream); }
.nav { display: flex; gap: 4px clamp(18px, 3vw, 36px); align-items: center; flex-wrap: wrap; font-size: 1.125rem; font-weight: 600; }
.nav a { text-decoration: none; padding-block: 12px; }
.nav a:hover { color: var(--gold); }
.nav a[aria-current="page"] { background-image: var(--stitch); background-size: 16px 2px; background-repeat: round no-repeat; background-position: 0 80%; }
.nav .buy { color: var(--gold); display: inline-flex; align-items: center; gap: 6px; }
.nav .buy svg { width: 18px; height: 18px; }

/* Hero: one quilt, hung under a picture light */
.hero { position: relative; padding-block: clamp(36px, 6vw, 80px) clamp(56px, 8vw, 110px); overflow: hidden; }
.hero-grid { position: relative; display: grid; gap: clamp(28px, 5vw, 72px); align-items: end; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.hung { margin: 0; position: relative; isolation: isolate; }
/* the picture light: brightest just above the quilt's top edge, fading in every direction */
.hung::before { content: ""; position: absolute; z-index: -1; inset: -140px -10% 40%; background: radial-gradient(ellipse 50% 45% at 50% 42%, color-mix(in srgb, var(--cream) 16%, transparent), transparent 100%); pointer-events: none; }
.hung button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.hung button:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.hung img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 28px 34px var(--shadow)) drop-shadow(0 6px 8px color-mix(in srgb, var(--night) 50%, transparent)); transition: transform .5s var(--ease); }
.hung button:hover img { transform: translateY(-4px); }
.intro { display: grid; gap: 26px; }
.intro h1 { font-size: var(--step-4); }
.lede { font-size: var(--step-1); color: var(--cream-soft); max-width: 30ch; }
/* Wall label: a violet card that belongs to the wall, soft corners, a lavender hairline, gold-stitched link */
.label { background: var(--alcove); color: var(--cream); padding: 22px 26px 18px; max-width: 340px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lavender) 35%, transparent), 0 14px 32px color-mix(in srgb, var(--night) 45%, transparent); display: grid; gap: 4px; }
.label-title { font-family: var(--display); font-size: var(--step-label); line-height: 1.1; overflow-wrap: anywhere; hyphens: auto; }
.label .stitch { font-weight: 700; justify-self: start; margin-top: 8px; }
@media (max-width: 480px) {
  .hung img { max-height: 42svh; }
  .lede { order: 1; }
  .actions { order: 2; }
}
.actions { display: flex; gap: 22px 30px; flex-wrap: wrap; align-items: center; }

/* The thread: one running stitch that sews itself across the hero on load */
.thread { position: absolute; left: 0; bottom: 26px; width: max(100%, 1440px); height: 60px; pointer-events: none; }
.thread path { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 10 9; }
.thread .needle { animation: sew 2.6s var(--ease) .3s both; }
@media (max-width: 899px) { .thread { bottom: 4px; height: 40px; } }
@keyframes sew { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Section rhythm */
.section { padding-block: clamp(56px, 8vw, 112px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { font-size: var(--step-3); max-width: 16ch; }
.section-head p { color: var(--cream-soft); max-width: 42ch; }

/* Salon hang: justified rows that keep every quilt's true proportions, never cropped */
.salon { display: flex; flex-wrap: wrap; gap: clamp(40px, 5vw, 72px) clamp(28px, 3.6vw, 56px); }
.salon::after { content: ""; flex-grow: 999; }
.work { flex: var(--ar) 1 calc(var(--ar) * var(--row, 300px)); max-width: calc(var(--ar) * 420px); margin: 0; min-width: 0; }
.work button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.work button:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.work img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); box-shadow: 0 14px 22px var(--shadow); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.work button:hover img { transform: translateY(-4px); box-shadow: 0 22px 30px var(--shadow); }
.work figcaption { margin-top: 12px; font-size: var(--step-small); color: var(--lavender); line-height: 1.35; overflow-wrap: anywhere; hyphens: auto; }
/* Phones: one quilt per row, as large as the screen allows */
@media (max-width: 640px) {
  .work { flex: 1 1 100%; max-width: none; }
  .work img { width: auto; max-width: 100%; max-height: 70svh; }
}

/* Wall text: her words hung between the quilts, as on the original gallery */
/* fills the rest of its row, so no group ends half empty */
.wall-text { flex: 1 1 320px; margin: 0; align-self: center; }
.wall-text p { max-width: 26ch; font-family: var(--display); font-size: var(--step-2); line-height: 1.3; color: var(--cream); text-wrap: balance; }

/* Her career, in her words */
.story { display: grid; gap: clamp(28px, 5vw, 80px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .story { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.story h2 { font-size: var(--step-3); }
.body { display: grid; gap: 22px; max-width: 50ch; color: var(--cream-soft); }
.body > p:first-child { font-size: var(--step-1); color: var(--cream); }
.body > .stitch { justify-self: start; }
.books { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 14px; }
.books li { padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--cream) 14%, transparent); }
.books cite { font-family: var(--display); font-style: normal; font-size: var(--step-1); color: var(--cream); display: block; }

/* The prints room */
.prints { background: var(--alcove); }
.prints-grid { display: grid; gap: clamp(28px, 5vw, 72px); grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 900px) { .prints-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.prints h2 { font-size: var(--step-3); }
.prints .copy { display: grid; gap: 22px; }
.prints .copy > p { color: var(--cream-soft); max-width: 46ch; }
.how { list-style: none; counter-reset: how; padding: 0; margin: 0; display: grid; gap: 14px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 12px; align-items: baseline; }
.how li::before { content: counter(how); font-family: var(--display); font-size: var(--step-label); color: var(--gold); }
.btn { display: inline-flex; align-items: center; gap: 12px; justify-self: start; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 1.125rem; text-decoration: none; padding: 16px 26px; min-height: 56px; border-radius: var(--radius); box-shadow: 0 8px 18px color-mix(in srgb, var(--night) 40%, transparent); transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 24px color-mix(in srgb, var(--night) 50%, transparent); background-color: color-mix(in srgb, var(--gold) 88%, var(--cream)); }
.btn:active { transform: translateY(0); box-shadow: 0 4px 10px color-mix(in srgb, var(--night) 40%, transparent); }
.btn svg { width: 20px; height: 20px; flex: none; }
.trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; }
.trio button { all: unset; cursor: zoom-in; display: block; }
.trio button:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.trio img { width: 100%; height: auto; display: block; box-shadow: 0 16px 24px var(--shadow); }
.trio button:nth-child(2) { transform: translateY(-18px); }
.closing { display: grid; gap: 22px; justify-items: start; }
.closing p { color: var(--cream-soft); max-width: 46ch; }

/* Gallery page */
.page-head { padding-block: clamp(40px, 6vw, 80px) 0; display: grid; gap: 14px; }
.page-head h1 { font-size: var(--step-4); }
.page-head p { color: var(--cream-soft); font-size: var(--step-1); max-width: 46ch; }
.page-head + .section { padding-top: clamp(32px, 4vw, 56px); }

/* About page */
.about { display: grid; gap: clamp(28px, 5vw, 80px); grid-template-columns: minmax(0, 1fr); padding-block: clamp(40px, 6vw, 80px); }
@media (min-width: 900px) { .about { grid-template-columns: 200px minmax(0, 1fr); } }
.portrait { margin: 0; display: grid; gap: 14px; align-content: start; }
.portrait img { width: 200px; height: auto; box-shadow: 0 14px 22px var(--shadow); }
.portrait figcaption { font-size: var(--step-small); color: var(--cream-soft); }
.about h1 { font-size: var(--step-3); margin-bottom: 26px; }
.feature { padding-top: 0; }

/* Write to Dottie: a violet bay like the prints room, with cream fields */
.contact { background: var(--alcove); scroll-margin-top: 96px; } /* clears the sticky desktop header */
.contact-grid { display: grid; gap: clamp(28px, 5vw, 72px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.contact h2 { font-size: var(--step-3); margin-bottom: 22px; }
.contact .copy p { color: var(--cream-soft); max-width: 40ch; }
.contact-form { display: grid; gap: 8px; max-width: 560px; }
.contact-form label { font-weight: 600; margin-top: 12px; }
.contact-form label:first-child { margin-top: 0; }
.contact-form input, .contact-form textarea { font: inherit; color: var(--ink); background: var(--cream); border: 2px solid transparent; border-radius: var(--radius-field); padding: 12px 14px; min-height: 56px; width: 100%; caret-color: var(--ink); }
.contact-form textarea { resize: vertical; min-height: 168px; }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.contact-form :user-invalid { border: 3px solid var(--error); }
.contact-form ::selection { background: var(--ink); color: var(--cream); }
.contact-form .btn { margin-top: 16px; border: 0; cursor: pointer; font-family: inherit; }
.contact-form .btn:disabled { cursor: progress; opacity: .7; transform: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status:empty { display: none; }
.form-status { padding: 14px 16px; border-radius: var(--radius-field); font-weight: 600; background: var(--cream); color: var(--ink); border: 3px solid var(--gold); }
.form-status.is-error { border-color: var(--error); }
.form-status:focus { outline: none; }

/* Footer */
.foot { border-top: 1px solid color-mix(in srgb, var(--cream) 12%, transparent); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: center; padding-block: 40px; color: var(--cream-soft); font-size: var(--step-small); }
.foot a { color: var(--cream); font-weight: 600; }
.foot a:hover { color: var(--gold); }

/* Viewing room */
dialog { border: 0; padding: 0; background: var(--wall); color: var(--cream); inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
dialog::backdrop { background: color-mix(in srgb, var(--night) 80%, transparent); }
.room { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.room-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.icon-btn { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--cream); border: 1px solid color-mix(in srgb, var(--cream) 25%, transparent); transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.icon-btn:active { background: color-mix(in srgb, var(--gold) 15%, transparent); }
.icon-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.icon-btn svg { width: 22px; height: 22px; }
.room-art { position: relative; min-height: 0; touch-action: pan-y pinch-zoom; }
.room-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 26px 32px var(--shadow)); }
.room-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 24px; max-width: 1240px; width: 100%; margin-inline: auto; }
.room-label h2 { font-size: var(--step-2); flex: 1 1 280px; }
.room-nav { display: flex; gap: 10px; }
.count { font-size: var(--step-small); color: var(--lavender); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .thread .needle { animation: none; }
  .stitch, .btn, .work img, .icon-btn { transition: none; }
  .hung img { transition: none; }
  .work button:hover img, .hung button:hover img, .btn:hover { transform: none; }
}
