/* =====================================================================
   soraya.art — Soraya Laraqui portfolio
   Single stylesheet. Mobile-first.

   v2 — "Zellige Bazaar" UI character refresh:
   - Saturated palette sampled directly from her paintings
   - 8-point Moroccan zellige star (khatim) replaces the gradient divider
   - Every hero painting gets a rotating-color frame
   - Work-row numerals sit in tinted circle badges
   - Thin pattern strips at top of body and after the footer

   Shared chrome (search-and-replace targets if you edit them):
     <header class="site-header"> ... </header>
     <footer class="site-footer"> ... </footer>
   These are hand-copied into every HTML file. Edit one, then propagate.
   ===================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- Tokens ---------- */
:root {
  /* Warm butter cream — softer and warmer than drios.art's cool off-white.
     Evokes North African afternoon light. */
  --bg: #FBF4E4;
  --text: #1A1A1A;
  --muted: rgba(26, 26, 26, 0.6);
  --rule: rgba(26, 26, 26, 0.10);
  --row-hover: rgba(26, 26, 26, 0.03);

  /* "Zellige Bazaar" palette — sampled directly from Soraya's paintings.
     Accents 1–5 each correspond to one of the 5 works (red→blue→orange→
     teal→pink), so a viewer can mentally tag each piece to a color.
     Accent-6 (gold) is reserved for accents / icon hover. */
  --accent-1: #DC2626;  /* scarlet red    — her dominant red across all works */
  --accent-2: #1E40AF;  /* cobalt blue    — Arabic script in The Grill */
  --accent-3: #F97316;  /* bright orange  — Under the Arch crosshatch */
  --accent-4: #14B8A6;  /* mint teal      — L'Épicerie wall, Atlas floor */
  --accent-5: #EC4899;  /* hot pink       — Atlas Playground sky */
  --accent-6: #FBBF24;  /* gold           — Grill uniform script */

  /* Fraunces at heavier weights = chunky, joyful presence.
     DM Sans for UI — warmer than Inter. */
  --font-display: 'Fraunces', 'DM Serif Display', Georgia, serif;
  --font-ui: 'DM Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;
  --space-xxl: 10rem;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  line-height: 1.05;
}
strong, b { font-weight: 600; }

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--accent-1);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}
a:focus-visible { outline: 1px dotted var(--accent-1); outline-offset: 4px; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-lg); }
.section--loose { padding-block: var(--space-xxl); }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.muted { color: var(--muted); }
.italic { font-style: italic; }

/* ---------- Eyebrow ---------- */
.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}
/* Old aliases kept so existing HTML keeps working unchanged: */
.eyebrow--accent  { color: var(--accent-1); }
.eyebrow--red     { color: var(--accent-1); }
.eyebrow--blue    { color: var(--accent-2); }
.eyebrow--orange  { color: var(--accent-3); }
.eyebrow--green   { color: var(--accent-4); }  /* alias for teal — legacy class */
.eyebrow--teal    { color: var(--accent-4); }
.eyebrow--pink    { color: var(--accent-5); }
.eyebrow--gold    { color: var(--accent-6); }
.eyebrow--muted   { color: var(--muted); }

/* ---------- Pattern divider: 8-point Moroccan zellige star (khatim) ---------- */
/* The SVG repeat unit is 160×40, containing 4 stars in red→blue→orange→teal.
   Each star = an axis-aligned square overlaid with a 45°-rotated square
   (encoded as a diamond polygon), centered every 40px across the row.
   preserveAspectRatio='none' lets the same SVG scale into both the bold
   40px divider and the thin 14px header/footer strip without re-encoding. */
.pattern-divider {
  display: block;
  height: 40px;
  border: 0;
  margin: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 40' preserveAspectRatio='none'><rect x='5.86' y='5.86' width='28.28' height='28.28' fill='%23DC2626'/><polygon points='20,0 40,20 20,40 0,20' fill='%23DC2626'/><rect x='45.86' y='5.86' width='28.28' height='28.28' fill='%231E40AF'/><polygon points='60,0 80,20 60,40 40,20' fill='%231E40AF'/><rect x='85.86' y='5.86' width='28.28' height='28.28' fill='%23F97316'/><polygon points='100,0 120,20 100,40 80,20' fill='%23F97316'/><rect x='125.86' y='5.86' width='28.28' height='28.28' fill='%2314B8A6'/><polygon points='140,0 160,20 140,40 120,20' fill='%2314B8A6'/></svg>");
  background-repeat: repeat-x;
  background-size: 160px 40px;
  background-position: center;
}
.pattern-divider--thin {
  height: 14px;
  background-size: 56px 14px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 1.5rem;
}
.site-header__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.005em;
}
.site-nav ul {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.site-nav a {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding-block: 0.25rem;
}
.site-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--accent-1);
}
.site-nav a[aria-current="page"]:hover {
  border-bottom-color: transparent;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--space-xl);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 1.75rem;
}

@media (max-width: 600px) {
  .site-header .container { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .site-nav ul { gap: 1.25rem; }
  .site-footer .container { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* ---------- Media component (placeholder + auto-swap) ---------- */
/* Same JS contract as drios.art/js/assets.js — class hooks unchanged. */
.media {
  position: relative;
  width: 100%;
  background: rgba(26, 26, 26, 0.05);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.media--16x9  { aspect-ratio: 16 / 9; }
.media--16x10 { aspect-ratio: 16 / 10; }

.media img,
.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.media__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  word-break: break-all;
  pointer-events: none;
}
.media--loaded { background: transparent; border-color: transparent; }
.media--loaded img,
.media--loaded video { opacity: 1; }
.media--loaded .media__placeholder { display: none; }
.media--error img,
.media--error video { display: none; }

.media--natural img,
.media--natural video {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.media--natural:not(.media--loaded) {
  aspect-ratio: 16 / 10;
}
.media--natural:not(.media--loaded) img,
.media--natural:not(.media--loaded) video {
  position: absolute;
  inset: 0;
  height: 100%;
}
.media--natural.media--loaded {
  background: transparent;
  border-color: transparent;
}

/* Color-blocked frame around media — the "Hajjaj move" applied to images.
   Bumped from clamp(12, 2vw, 28) → clamp(18, 2.5vw, 36) so the colored
   border reads as a deliberate frame rather than a hairline. The framed
   class overrides .media--loaded's transparent background since we WANT
   the color showing as the frame. */
.media--framed {
  padding: clamp(18px, 2.5vw, 36px);
  background: var(--accent-1);
  border: 0;
}
.media--framed.media--loaded { background: var(--accent-1); }

/* Frame color modifiers — one per work, color rotates the same way the
   work-row numeral color rotates so a viewer can mentally pair pieces
   to colors. */
.media--frame-red    { background: var(--accent-1); }
.media--frame-blue   { background: var(--accent-2); }
.media--frame-orange { background: var(--accent-3); }
.media--frame-teal   { background: var(--accent-4); }
.media--frame-pink   { background: var(--accent-5); }
.media--frame-gold   { background: var(--accent-6); }
.media--framed.media--frame-red.media--loaded    { background: var(--accent-1); }
.media--framed.media--frame-blue.media--loaded   { background: var(--accent-2); }
.media--framed.media--frame-orange.media--loaded { background: var(--accent-3); }
.media--framed.media--frame-teal.media--loaded   { background: var(--accent-4); }
.media--framed.media--frame-pink.media--loaded   { background: var(--accent-5); }
.media--framed.media--frame-gold.media--loaded   { background: var(--accent-6); }

/* Legacy aliases — keep old class names working in case any HTML still uses them */
.media--frame-magenta { background: var(--accent-1); }
.media--frame-green   { background: var(--accent-4); }

.media--zoomable img { cursor: zoom-in; }
.media--zoomable::after {
  content: "Click to expand";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.45);
  color: #FBF4E4;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
@media (hover: hover) {
  .media--zoomable:hover::after { opacity: 1; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  cursor: zoom-out;
  animation: lightbox-in 0.18s ease-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Home ---------- */
.hero { padding-top: var(--space-xl); padding-bottom: var(--space-lg); }
.hero__eyebrow { margin-bottom: var(--space-md); }
.hero__title {
  font-size: clamp(56px, 9vw, 112px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  font-weight: 800;
  max-width: 16ch;
}
.hero__subtitle {
  margin-top: var(--space-md);
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 20px);
  max-width: 48ch;
}
.hero__media { margin-top: var(--space-lg); }

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
}
@media (min-width: 768px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
}
.pullquote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.3;
  max-width: 28ch;
}
.pullquote-link {
  display: inline-block;
  margin-top: var(--space-md);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-1);
  border-bottom: 2px solid var(--accent-1);
  padding-bottom: 0.2rem;
}
.pullquote-link:hover { text-decoration: none; }

/* ---------- Works list (used on home + portfolio) ---------- */
.works-heading {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 800;
  margin-bottom: var(--space-lg);
}
.works-list { border-top: 2px solid var(--text); }
.work-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  grid-template-areas:
    "num    text"
    "thumb  thumb";
  gap: var(--space-md);
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--rule);
  align-items: start;
  transition: background-color 0.18s ease;
}
@media (hover: hover) {
  .work-row:hover { background: var(--row-hover); text-decoration: none; }
  .work-row:hover .work-row__title {
    text-decoration: underline;
    text-decoration-color: var(--accent-1);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
  }
}

/* Color-blocked Arabic numerals inside tinted circle badges — the
   boldest layout-level departure from drios.art. The numeral itself
   uses `color` and the badge ::before uses `currentColor` at 14%
   opacity, so changing the numeral's color via nth-child also retints
   the badge. */
.work-row__numeral {
  grid-area: num;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1;
  color: var(--accent-1);
  isolation: isolate;
}
.work-row__numeral::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.14;
  z-index: -1;
}

/* 5-work rotation: red → blue → orange → teal → pink.
   Each piece "owns" one accent — same color also frames its hero
   painting on the work detail page. */
.work-row:nth-child(5n+1) .work-row__numeral { color: var(--accent-1); }
.work-row:nth-child(5n+2) .work-row__numeral { color: var(--accent-2); }
.work-row:nth-child(5n+3) .work-row__numeral { color: var(--accent-3); }
.work-row:nth-child(5n+4) .work-row__numeral { color: var(--accent-4); }
.work-row:nth-child(5n+5) .work-row__numeral { color: var(--accent-5); }

.work-row__thumb { grid-area: thumb; }
.work-row__text  { grid-area: text; }

.work-row__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 32px);
  line-height: 1.15;
}
.work-row__subtitle {
  display: block;
  margin-top: 0.4rem;
  font-style: italic;
  color: var(--muted);
  font-size: 16px;
}
.work-row__meta { margin-top: 0.85rem; color: var(--muted); }

@media (min-width: 768px) {
  .work-row {
    grid-template-columns: 96px minmax(280px, 1.1fr) 1.4fr;
    grid-template-areas: "num thumb text";
    gap: var(--space-lg);
    align-items: center;
    padding-block: var(--space-lg);
  }
  .work-row__numeral {
    width: 96px;
    height: 96px;
    font-size: clamp(38px, 4vw, 48px);
  }
}

/* ---------- Thesis ---------- */
.thesis {
  max-width: 680px;
  margin-inline: auto;
  padding-block: var(--space-xl);
}
.thesis__title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  margin-top: var(--space-md);
  letter-spacing: -0.015em;
}
.thesis__byline { margin-top: var(--space-sm); color: var(--muted); }
.thesis__body {
  margin-top: var(--space-lg);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.7;
}
.thesis__body p + p { margin-top: 1.4em; }

/* ---------- Work subpage ---------- */
.work { padding-top: var(--space-lg); }
.work__hero {
  max-width: 960px;
  margin-inline: auto;
  margin-top: var(--space-md);
}
.work__hero--pair {
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
@media (min-width: 768px) {
  .work__hero--pair { grid-template-columns: 1fr 1fr; }
}
.work__hero--pair .media { margin: 0; }
.work__title-block {
  max-width: 960px;
  margin-inline: auto;
  margin-top: var(--space-lg);
}
.work__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 5.5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.work__subtitle {
  display: block;
  margin-top: 0.55rem;
  font-style: italic;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 20px);
}
.work__meta { margin-top: 1.1rem; color: var(--muted); }

.work__statement {
  max-width: 640px;
  margin: var(--space-xl) auto 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text);
  font-size: 19px;
  line-height: 1.7;
}

.work__process { margin-top: var(--space-xl); }
.work__process-heading { margin-bottom: var(--space-lg); }
.work__process-list {
  display: grid;
  gap: var(--space-md);
  max-width: 960px;
  margin-inline: auto;
}

.work__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
}
.work__nav a { display: block; }
.work__nav-label { display: block; margin-bottom: 0.4rem; }
.work__nav-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 28px);
}
.work__nav--prev { text-align: left; }
.work__nav--next { text-align: right; }

/* ---------- Contact ---------- */
.contact {
  padding-block: var(--space-xl);
  text-align: left;
}
.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}
.contact__portrait {
  max-width: 280px;
}
@media (min-width: 768px) {
  .contact__grid {
    grid-template-columns: 280px 1fr;
    gap: var(--space-xl);
  }
  .contact__portrait { max-width: none; }
}
.contact__email {
  display: inline-block;
  margin-top: var(--space-md);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--accent-1);
  word-break: break-word;
}
.contact__note { margin-top: var(--space-md); color: var(--muted); max-width: 48ch; }
