/* Atelier Aẓwar
   A beige page, like the ground of the logo. Sage and orange only in the small things:
   tabs, buttons, chosen formats. The cover is set the way the logo is set. Phone first. */

:root {
  --bg: #FAF3EE;          /* the logo's ground */
  --bg-2: #F2E6DC;
  --ink: #2E1E14;
  --muted: #5C4A3C;
  --orange: #A93D0F;
  --orange-strong: #8A300A;
  --sage: #736D4B;
  --sage-soft: #E3E2D0;
  --sage-ink: #4F4B2C;

  /* the sign's three inks, as on the logo */
  --e1: #A93D0F;
  --e2: #736D4B;
  --e3: #523F2E;

  --font-logo: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --font: "EB Garamond", Garamond, Georgia, serif;
  --font-tif: "Noto Sans Tifinagh", sans-serif;

  --step-small: 0.9375rem;                                  /* 15px */
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);     /* 17–20px */
  --step-lead: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);    /* 22–28px */
  --step-head: clamp(2.5rem, 1.7rem + 3vw, 4.25rem);        /* 40–68px */
  --step-name: clamp(3.25rem, 1.6rem + 6vw, 6.5rem);        /* the logo name */

  --margin: clamp(1rem, 3vw, 2.5rem);
  --gutter: clamp(1rem, 2.4vw, 2.5rem);
  --section: clamp(5rem, 11vw, 10rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, figure, fieldset { margin: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-logo); font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }
:target { scroll-margin-top: 4.5rem; }
::selection { background: var(--orange); color: var(--bg); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.head { font-size: var(--step-head); line-height: 1; letter-spacing: -0.01em; }
.t-orange { color: var(--orange); }
.t-sage { color: var(--sage); }
.tif { font-family: var(--font-tif); }

/* ---------- controls ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 1.75rem;
  background: var(--orange); color: var(--bg);
  font-size: var(--step-body); font-weight: 500; line-height: 1.1;
  text-decoration: none; border: 0; border-radius: 0; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
.button--small { min-height: 2.75rem; padding: 0 1.25rem; }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background-color: var(--orange-strong); }
  .link:hover { text-decoration-color: currentColor; color: var(--orange); }
}

/* small sage tab: the work's family */
.tab { display: inline-block; width: fit-content; padding: 0.2rem 0.8rem; background: var(--sage-soft); color: var(--sage-ink); font-size: var(--step-small); line-height: 1.4; }
.tab--orange { background: #F3DCCD; color: var(--orange-strong); }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: center; gap: clamp(1.25rem, 4vw, 3rem);
  padding: 0.5rem var(--margin);
  background: var(--bg);
}
.nav__link { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; transition: color var(--t-hover) ease; }
.nav__link--action { color: var(--orange); }
@media (hover: hover) and (pointer: fine) { .nav__link:hover { color: var(--orange); } }

/* =========================================================
   Cover: the logo
   ========================================================= */
.cover { display: grid; }
.cover__logo {
  min-height: calc(100svh - 3.75rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem var(--margin) 3rem;
}
.cover__mark { width: clamp(5.5rem, 22vw, 8.5rem); aspect-ratio: 84 / 104; height: auto; }
.cover__name {
  font-size: var(--step-name); line-height: 1; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.3em; margin-right: -0.3em;
  margin-top: 1.5rem;
}
.cover__tag {
  display: flex; align-items: center; gap: 0.75rem;
  margin-top: 1rem; font-family: var(--font-logo); font-size: var(--step-lead); letter-spacing: 0.12em; color: var(--muted);
}
.cover__tag::before, .cover__tag::after { content: ""; width: 0.4rem; height: 0.4rem; background: var(--orange); transform: rotate(45deg); }
.cover__word { margin-top: 1.75rem; font-family: var(--font-logo); font-size: var(--step-lead); letter-spacing: 0.06em; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; }
.cover__bar { color: var(--muted); }
.cover__desc { margin-top: 1rem; max-width: 34rem; font-family: var(--font-logo); font-size: var(--step-lead); line-height: 1.45; font-weight: 500; }
.cover__by { margin-top: 1.5rem; font-style: italic; color: var(--muted); }
.cover__logo .button { margin-top: 1.75rem; }
.cover__photo { padding: 0 var(--margin); }
.cover__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 54% 40%; }

@media (min-width: 56em) {
  .cover { grid-template-columns: 1fr 1fr; column-gap: var(--gutter); padding: 0 var(--margin) var(--margin); min-height: calc(100svh - 3.75rem); }
  .cover__logo { min-height: 0; padding: 2rem 0; }
  .cover__photo { padding: 0; }
  .cover__photo img { height: 100%; aspect-ratio: auto; }
}

/* =========================================================
   The works
   ========================================================= */
.works { padding: var(--section) var(--margin) 0; }
.works__head { display: grid; gap: 1rem; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.works__head p { max-width: 38ch; font-size: var(--step-lead); line-height: 1.35; }
.works__grid { display: grid; gap: 3.5rem var(--gutter); }
.work { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.work img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; margin-bottom: 0.6rem; }
.work--wide img { aspect-ratio: 5 / 3; }
.work__title { font-size: var(--step-lead); line-height: 1.1; font-weight: 600; }
.work__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; }
.work__price { color: var(--muted); }
.work__poem summary { cursor: pointer; color: var(--sage); min-height: 2.75rem; display: inline-flex; align-items: center; gap: 0.5rem; list-style: none; text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 0.07em; }
.work__poem summary::-webkit-details-marker { display: none; }
.work__poem summary::after { content: "+"; text-decoration: none; display: inline-block; }
.work__poem[open] summary::after { content: "−"; }
.work__poem p { margin: 0.5rem 0 0.9rem; font-style: italic; line-height: 1.5; }
.work .button { margin-top: 0.25rem; }

@media (min-width: 40em) {
  .works__grid { grid-template-columns: 1fr 1fr; }
  .work--wide { grid-column: 1 / -1; }
}
@media (min-width: 64em) {
  .works__head { grid-template-columns: 1fr 1fr; align-items: end; column-gap: var(--gutter); }
  .works__grid { grid-template-columns: repeat(3, 1fr); row-gap: 5rem; }
  .work--wide { grid-column: span 2; }
}

/* =========================================================
   The artist's words
   ========================================================= */
.about { padding: var(--section) var(--margin) 0; display: grid; gap: 2.5rem; }
.about__photo { margin-top: 0.5rem; }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 60%; }
.about__text { display: flex; flex-direction: column; gap: 1.25rem; }
.about__text p { max-width: 60ch; }
.about__sign { font-family: var(--font-logo); font-style: italic; font-size: var(--step-head); line-height: 1; color: var(--orange); margin-top: 0.75rem; }
@media (min-width: 56em) {
  .about__photo { order: -1; margin-top: 0; }
  .about { grid-template-columns: 5fr 7fr; column-gap: clamp(2rem, 6vw, 6rem); align-items: center; }
}

/* =========================================================
   Order
   ========================================================= */
.order { margin-top: var(--section); background: var(--bg-2); padding: var(--section) var(--margin); display: grid; gap: 2.5rem; }
.order__form { display: flex; flex-direction: column; gap: 0.9rem; }
.order__intro { max-width: 40ch; margin-bottom: 0.75rem; }
.order__label { font-size: var(--step-small); color: var(--muted); padding: 0; margin-top: 0.5rem; }
.field {
  width: 100%; min-height: 3.25rem; padding: 0.6rem 2.75rem 0.6rem 1rem;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23736D4B' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 1rem center;
  border: 0; border-radius: 0; appearance: none; font-size: max(1rem, var(--step-body));
}
.order__formats { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.order__formats legend { margin-bottom: 0.5rem; }
.chip { position: relative; flex: 1 1 8rem; cursor: pointer; }
.chip[hidden] { display: none; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.75rem 1rem; background: var(--bg); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.chip b { font-weight: 500; }
.chip input:checked + span { background: var(--sage); color: var(--bg); }
.chip input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .chip:hover input:not(:checked) + span { background: var(--sage-soft); } }
.order__total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1rem; font-size: var(--step-lead); line-height: 1.25; }
.order__total b { font-weight: 500; color: var(--orange); white-space: nowrap; }
.order__send { width: 100%; margin-top: 0.5rem; }
.order__note { font-size: var(--step-small); color: var(--muted); }
.order__preview img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity 250ms ease; }
.order__preview img.is-changing { opacity: 0; }
.order__preview img.is-pair { object-fit: contain; background: #F0E4D6; }
@media (max-width: 55.99em) { .order__preview { display: none; } }
@media (min-width: 56em) {
  .order { grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 6vw, 6rem); align-items: center; }
  .order__send { width: auto; align-self: flex-start; }
}

/* =========================================================
   Footer: the logo again, small
   ========================================================= */
.foot { padding: var(--section) var(--margin) 2rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.foot__mark { width: 3.5rem; aspect-ratio: 84 / 104; height: auto; }
.foot__name { margin-top: 1rem; font-size: var(--step-head); line-height: 1; text-transform: uppercase; letter-spacing: 0.3em; margin-right: -0.3em; }
.foot__tag { margin-top: 0.5rem; font-family: var(--font-logo); font-size: var(--step-lead); letter-spacing: 0.12em; color: var(--muted); }
.foot__line { margin-top: 1.75rem; max-width: 32ch; }
.foot__links { margin-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.75rem; }
.foot__links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--orange); }
.foot__imprint { margin-top: 2.5rem; font-size: var(--step-small); color: var(--muted); }

/* =========================================================
   Motion (content is in place without script)
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .js .cover__mark { animation: grow 1.1s var(--ease-out) both; transform-origin: 50% 0; }
  .js .cover__logo > :not(.cover__mark) { animation: rise 800ms var(--ease-out) both; }
  .js .cover__name { animation-delay: 150ms !important; }
  .js .cover__tag { animation-delay: 250ms !important; }
  .js .cover__word { animation-delay: 350ms !important; }
  .js .cover__desc { animation-delay: 450ms !important; }
  .js .cover__by, .js .cover__logo .button { animation-delay: 550ms !important; }
  .js .cover__photo img { animation: settle 2.4s var(--ease-soft) both; }
  .js .cover__photo { overflow: hidden; }
  .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .work img { transition: transform 600ms var(--ease-out); }
  @media (hover: hover) and (pointer: fine) { .work:hover img { transform: scale(1.015); } }
}
@keyframes grow { from { opacity: 0; transform: scaleY(0.5); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }
