/*
  Dokpa Garment, Himalayan Craft study.
  Shared stylesheet for index.html, made.html, garments.html, visit.html.
  Palette: paper ground, deep ink text, one warm accent pulled from the
  red and gold patterned tote cloth in the supplied photographs.
*/

:root {
  --paper: #f4ede0;
  --paper-deep: #ece2ce;
  --ink: #241f1a;
  --ink-soft: #4a3f34;
  --line: #ded0b3;
  --accent-red: #a3402b;
  --accent-red-deep: #832f1e;
  --accent-gold: #c1953f;
  --white: #fffaf1;

  --font-display: "Fraunces", Georgia, "Iowan Old Style", serif;
  --font-body: "Karla", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --container: min(92vw, 1240px);
  --measure: 64ch;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.25rem;
  --space-5: 3.5rem;
  --space-6: 5rem;
  --space-7: 7rem;
  --space-8: 9rem;

  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 var(--space-2);
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 var(--space-3);
}

.wrap {
  width: var(--container);
  margin-inline: auto;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -3rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  z-index: 100;
  transition: top 0.2s var(--ease-soft);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
}

.skip-link:focus {
  top: var(--space-2);
}

/* Focus visibility, never removed without a real replacement */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Design study notice */
.notice {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  padding: 0.6rem var(--space-2);
}

.notice strong {
  color: var(--accent-gold);
  font-weight: 700;
}

/* Header and navigation */
.site-header {
  padding: var(--space-3) 0 var(--space-2);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.brand span {
  color: var(--accent-red);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0.3rem;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  gap: 0.5rem;
}

.nav-toggle-bars {
  display: inline-block;
  width: 1.1rem;
  height: 0.85rem;
  position: relative;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-toggle-bars::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 2px solid currentColor;
  transform: translateY(-1px);
}

.primary-nav .nav-list {
  list-style: none;
  display: flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.primary-nav .nav-list a {
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
}

.primary-nav .nav-list a:hover,
.primary-nav .nav-list a[aria-current="page"] {
  border-bottom-color: var(--accent-red);
  color: var(--accent-red-deep);
}

/* Mobile navigation: the collapsed list is removed with the `hidden`
   attribute (toggled by site.js) rather than a visual only max-height
   clip, so a collapsed list is also pulled out of the keyboard tab order
   below 768px instead of leaving invisible, clipped-focus-ring links in
   it. The attribute is only ever set by site.js, so with JavaScript
   disabled the list carries no [hidden] and stays visible at every width.
   The second selector raises specificity above `.primary-nav .nav-list`'s
   own `display: flex` so [hidden] actually wins. */
[hidden],
.primary-nav .nav-list[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .primary-nav .nav-list {
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    padding-top: var(--space-2);
  }

  .primary-nav {
    width: 100%;
    order: 3;
  }
}

/* Reveal on scroll, fails safe if JS never runs */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .media img {
    transition: none !important;
  }
}

/* Media, slow soft hover scale */
.media {
  overflow: hidden;
  background: var(--paper-deep);
}

.media img {
  width: 100%;
  height: auto;
  transition: transform 1.4s var(--ease-soft);
}

.media:hover img {
  transform: scale(1.045);
}

/* Hero */
.hero {
  position: relative;
  color: var(--white);
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* Darkened scrim, tuned against the actual hero photographs rather than
   guessed. The four hero images sampled bright (workroom carpet, a wooden
   table, pale walls), and the previous gradient topped out at 0.78 opacity,
   which left the eyebrow (gold on photo) and .hero p (paper on photo) well
   under the 4.5:1 WCAG 1.4.3 floor across all four hero images (measured as
   low as 1.36:1 for the eyebrow and 3.22:1 for .hero p). hero-content is
   bottom anchored, so the gradient now stays light through the top half of
   the photo (kept editorial) and ramps to a near opaque dark base under the
   text: sampling the same four images across the bottom 45% of the frame,
   where the text actually sits, gives a worst case of 4.92:1 for the gold
   eyebrow and 11.6:1 for the paper paragraph, both comfortably clearing
   4.5:1. */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 12, 9, 0.3) 0%,
    rgba(15, 12, 9, 0.5) 35%,
    rgba(15, 12, 9, 0.9) 58%,
    rgba(15, 12, 9, 0.96) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-block: var(--space-6) var(--space-5);
  max-width: 46rem;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: var(--space-2);
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.6rem, 6vw, 4.75rem);
  margin-bottom: var(--space-3);
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero p {
  color: var(--paper);
  font-size: 1.15rem;
  max-width: 42ch;
}

.hero-secondary {
  min-height: 52vh;
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

/* Buttons and links styled as buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: background 0.3s var(--ease-soft), color 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft);
}

.btn-solid {
  background: var(--accent-red);
  color: var(--white);
}

.btn-solid:hover {
  background: var(--accent-red-deep);
}

.btn-outline {
  border-color: var(--white);
  color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--ink);
}

.btn-outline-ink {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-outline-ink:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Sections and rhythm */
main {
  display: block;
}

section {
  padding-block: var(--space-6);
}

.section-head {
  max-width: var(--measure);
  margin-bottom: var(--space-4);
}

.section-head h2 {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-red-deep);
  margin-bottom: var(--space-1);
  display: block;
}

.measure {
  max-width: var(--measure);
}

/* Asymmetric editorial pairs */
.pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: center;
}

.pair-text {
  max-width: var(--measure);
}

@media (min-width: 900px) {
  .pair {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-6);
  }

  .pair--text-first {
    grid-template-columns: 7fr 5fr;
  }

  .pair--text-first .pair-media {
    order: 2;
  }

  .pair--offset-down .pair-text {
    margin-top: var(--space-6);
  }

  .pair--offset-up .pair-media {
    margin-top: calc(var(--space-6) * -1);
  }
}

.pair figcaption,
.media-caption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-top: 0.6rem;
  font-style: italic;
}

/* Pull quote, the site's own words, never attributed */
.pull-quote {
  margin: 0;
  padding: var(--space-5) 0;
  text-align: center;
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  line-height: 1.32;
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  max-width: 44rem;
  margin: 0 auto;
}

.pull-quote .rule {
  width: 3rem;
  height: 3px;
  background: var(--accent-red);
  margin: 0 auto var(--space-3);
}

/* Full bleed band */
.full-bleed {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 60vh;
  overflow: hidden;
}

.full-bleed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 60vh;
}

.full-bleed-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-4) var(--space-3);
  background: linear-gradient(0deg, rgba(24, 19, 14, 0.75) 0%, rgba(24, 19, 14, 0) 100%);
  color: var(--white);
  text-align: center;
}

.full-bleed-caption p {
  max-width: 40rem;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-style: italic;
}

/* Closing link cards */
.link-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 700px) {
  .link-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.link-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: var(--space-4);
  background: var(--white);
  transition: border-color 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

.link-card:hover {
  border-color: var(--accent-red);
  transform: translateY(-3px);
}

.link-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.link-card span.arrow {
  color: var(--accent-red);
  font-weight: 700;
}

/* Accordion, made.html */
.accordion {
  border-top: 1px solid var(--line);
}

.acc-item {
  border-bottom: 1px solid var(--line);
}

.acc-item h2 {
  margin: 0;
}

.acc-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 600;
  color: var(--ink);
  padding: var(--space-3) var(--space-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.acc-trigger:hover {
  color: var(--accent-red-deep);
}

.acc-trigger .acc-icon {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.acc-trigger .acc-icon::before,
.acc-trigger .acc-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  top: 50%;
  left: 50%;
}

.acc-trigger .acc-icon::before {
  width: 0.7rem;
  height: 2px;
  transform: translate(-50%, -50%);
}

.acc-trigger .acc-icon::after {
  width: 2px;
  height: 0.7rem;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.acc-trigger[aria-expanded="true"] .acc-icon::after {
  opacity: 0;
}

.acc-panel {
  padding: 0 var(--space-1) var(--space-4);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.acc-panel[hidden] {
  display: none;
}

@media (min-width: 860px) {
  .acc-panel {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
    gap: var(--space-4);
  }
}

.acc-panel .acc-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.acc-panel .acc-gallery figure {
  margin: 0;
}

/* Garment features, editorial list, not a grid of cards */
.garment-feature {
  padding-block: var(--space-6);
  border-top: 1px solid var(--line);
}

.garment-feature:first-of-type {
  border-top: 0;
}

.garment-feature .tag {
  display: inline-block;
  background: var(--accent-gold);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: var(--space-2);
}

/* Contact / visit page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: var(--space-4);
}

.contact-card dl {
  margin: 0;
}

.contact-card dt {
  font-weight: 700;
  color: var(--accent-red-deep);
  margin-top: var(--space-2);
}

.contact-card dt:first-child {
  margin-top: 0;
}

.contact-card dd {
  margin: 0 0 var(--space-1);
}

.contact-card a {
  text-decoration: underline;
  text-decoration-color: var(--accent-gold);
  text-underline-offset: 3px;
}

.form-note {
  background: var(--paper-deep);
  border-left: 4px solid var(--accent-gold);
  padding: var(--space-2) var(--space-3);
  font-size: 0.95rem;
  margin-bottom: var(--space-3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: var(--space-3);
}

.field label {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Form control boundary: the shared --line border (#ded0b3) on the --white
   card background (#fffaf1) measures 1.47:1, well under the WCAG 1.4.11
   3:1 floor for a UI component boundary, so the three visit.html fields
   read as blank space. --ink-soft (#4a3f34), already in this palette,
   measures 9.84:1 against the same --white fill, so it is used here for
   form control borders only, leaving --line as is everywhere else. */
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--ink-soft);
  border-radius: 0.3rem;
  background: var(--white);
  color: var(--ink);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding-block: var(--space-5);
  margin-top: var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
}

.site-footer h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.5rem;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-legal {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  section {
    padding-block: var(--space-5);
  }

  .hero-content {
    padding-block: var(--space-5) var(--space-4);
  }
}
