/* ReineCrafts — Artisan portfolio
   Palette: warm linen surfaces, clay + deep berry accents, charcoal text. */

:root,
[data-theme='light'] {
  /* Surfaces — warm linen */
  --color-bg: #f6f1ea;
  --color-surface: #fbf8f3;
  --color-surface-2: #f1ebe1;
  --color-surface-offset: #ece4d8;
  --color-divider: #ddd3c4;
  --color-border: #d4c8b4;

  /* Text — charcoal */
  --color-text: #2b2620;
  --color-text-muted: #6f665b;
  --color-text-faint: #a99e8e;
  --color-text-inverse: #f9f5ee;

  /* Accents — clay terracotta + deep berry */
  --color-clay: #b5552e;
  --color-clay-hover: #9a4624;
  --color-berry: #6e2a3f;
  --color-berry-hover: #561f30;

  /* Roles */
  --color-primary: var(--color-berry);
  --color-primary-hover: var(--color-berry-hover);

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sm: 0 1px 2px rgba(43, 38, 32, 0.06);
  --shadow-md: 0 6px 20px rgba(43, 38, 32, 0.08);
  --shadow-lg: 0 18px 48px rgba(43, 38, 32, 0.12);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1180px;

  --font-display: 'Boska', 'Georgia', serif;
  --font-body: 'Switzer', 'Helvetica Neue', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #1a1714;
  --color-surface: #211d19;
  --color-surface-2: #27221d;
  --color-surface-offset: #2c2620;
  --color-divider: #34302a;
  --color-border: #3f3a32;

  --color-text: #e4ddd2;
  --color-text-muted: #a89e90;
  --color-text-faint: #756c60;
  --color-text-inverse: #221d18;

  --color-clay: #d68a5e;
  --color-clay-hover: #e0a079;
  --color-berry: #c98ba0;
  --color-berry-hover: #d6a0b2;

  --color-primary: var(--color-berry);
  --color-primary-hover: var(--color-berry-hover);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
}

/* Type scale */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.4rem);
  --text-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem);
  --text-2xl: clamp(2.2rem, 1.4rem + 3vw, 4rem);
  --text-hero: clamp(2.8rem, 1rem + 7vw, 6.5rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem; --space-20: 5rem; --space-24: 6rem; --space-32: 8rem;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none; text-size-adjust: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh; line-height: 1.65;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--color-text); background-color: var(--color-bg);
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3 { text-wrap: balance; line-height: 1.12; font-family: var(--font-display); font-weight: 500; }
p, li, figcaption { text-wrap: pretty; }

::selection { background: color-mix(in oklab, var(--color-clay) 30%, transparent); color: var(--color-text); }
:focus-visible { outline: 2px solid var(--color-clay); outline-offset: 3px; border-radius: var(--radius-sm); }

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'] { transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.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; }

/* Layout helpers */
.container { width: min(100% - 2.5rem, var(--content-default)); margin-inline: auto; }
.container--wide { width: min(100% - 2.5rem, var(--content-wide)); margin-inline: auto; }

.eyebrow {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--color-clay);
}

.section-title { font-size: var(--text-xl); margin-top: var(--space-2); }
.lede { font-size: var(--text-lg); color: var(--color-text-muted); line-height: 1.55; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header--scrolled { border-bottom-color: var(--color-divider); box-shadow: var(--shadow-sm); }
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); height: 4.5rem;
}

.logo { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--color-text); text-decoration: none; }
.logo__mark { width: 30px; height: 30px; color: var(--color-clay); flex-shrink: 0; }
.logo__text { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); letter-spacing: -0.01em; }

.nav__list { display: flex; gap: var(--space-8); }
.nav__link { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); text-decoration: none; }
.nav__link:hover { color: var(--color-text); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-full);
  color: var(--color-text-muted); border: 1px solid var(--color-border);
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-clay); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.4rem; border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap;
}
.btn--lg { padding: 0.9rem 1.8rem; font-size: var(--text-base); }
.btn--primary { background: var(--color-berry); color: var(--color-text-inverse); }
.btn--primary:hover { background: var(--color-berry-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { border-color: var(--color-clay); color: var(--color-clay); }

.link { color: var(--color-clay); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--color-clay) 40%, transparent); }
.link:hover { color: var(--color-clay-hover); border-bottom-color: var(--color-clay); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(var(--space-20), 14vh, var(--space-32));
}
.hero__inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(var(--space-8), 5vw, var(--space-20)); align-items: center; position: relative; z-index: 2; }
.hero__copy { max-width: 620px; }
.hero__title {
  font-size: var(--text-hero); font-weight: 500; margin-top: var(--space-4);
  letter-spacing: -0.02em; line-height: 1.02;
}
.hero__title em { font-style: italic; color: var(--color-clay); font-weight: 400; }
.hero__lede { font-size: var(--text-lg); color: var(--color-text-muted); margin-top: var(--space-6); max-width: 46ch; line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-10); }

.hero__image { position: relative; }
.hero__image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }

/* Artist story — centerpiece */
.story {
  background: var(--color-surface);
  padding-block: clamp(var(--space-16), 8vw, var(--space-32));
  border-block: 1px solid var(--color-divider);
}
.story__grid {
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: clamp(var(--space-8), 5vw, var(--space-20));
  align-items: start;
}
.story__media img { border-radius: var(--radius-lg); width: 100%; box-shadow: var(--shadow-md); }
.story__caption { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-3); font-style: italic; }
.story__video { margin-top: var(--space-6); }
.story__video video { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: block; background: var(--color-surface-offset-2); }
.story__video figcaption { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-3); font-style: italic; }

.story__text { max-width: 52ch; }
.story__text .lede { margin-top: var(--space-5); }

.pullquote {
  margin: var(--space-10) 0; padding-left: var(--space-6);
  border-left: 3px solid var(--color-clay);
}
.pullquote p { font-family: var(--font-display); font-size: var(--text-lg); font-style: italic; font-weight: 400; color: var(--color-text); line-height: 1.4; }

.story__meta { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-12); padding-top: var(--space-8); border-top: 1px solid var(--color-divider); }
.story__meta li { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); }
.story__meta-label { font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-faint); font-weight: 600; }

/* Work / gallery — masonry */
.work { padding-block: clamp(var(--space-16), 8vw, var(--space-32)); }
.section-head { max-width: 60ch; margin-bottom: var(--space-12); }
.section-head .section-title { font-size: var(--text-2xl); }

.gallery-group { margin-top: var(--space-16); }
.gallery-group:first-of-type { margin-top: var(--space-12); }
.gallery-group__title {
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500;
  margin-bottom: var(--space-6); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  display: flex; align-items: baseline; gap: var(--space-3);
}

.gallery {
  column-count: 3;
  column-gap: var(--space-5);
}
.gallery__item {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); margin: 0 0 var(--space-5);
  break-inside: avoid; display: block;
}
.gallery__item--feature { box-shadow: var(--shadow-md); }
.gallery__item img { width: 100%; height: auto; display: block; transition: transform 600ms cubic-bezier(0.16,1,0.3,1); }
.gallery__item:hover img { transform: scale(1.03); }

.gallery__item figcaption {
  position: absolute; inset: auto 0 0 0; padding: var(--space-12) var(--space-5) var(--space-5);
  background: linear-gradient(to top, rgba(20,16,12,0.78), transparent);
  color: #f7f1e8; display: flex; flex-direction: column; gap: var(--space-1);
}
.gallery__label { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; }
.gallery__desc { font-size: var(--text-sm); opacity: 0.85; }

/* Contact */
.contact {
  background: var(--color-surface-offset); text-align: center;
  padding-block: clamp(var(--space-16), 9vw, var(--space-32));
}
.contact__inner { max-width: var(--content-narrow); margin-inline: auto; }
.contact .section-title { font-size: var(--text-2xl); margin-top: var(--space-3); }
.contact__lede { color: var(--color-text-muted); font-size: var(--text-lg); margin-top: var(--space-5); margin-bottom: var(--space-10); }
.contact__note { margin-top: var(--space-6); font-size: var(--text-sm); color: var(--color-text-muted); }

/* Footer */
.footer { border-top: 1px solid var(--color-divider); padding-block: var(--space-12); }
.footer__inner { display: flex; flex-direction: column; gap: var(--space-2); text-align: center; }
.footer__brand { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; }
.footer__meta { font-size: var(--text-sm); color: var(--color-text-muted); }
.footer__copy { font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-3); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms cubic-bezier(0.16,1,0.3,1), transform 700ms cubic-bezier(0.16,1,0.3,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 880px) {
  .story__grid { grid-template-columns: 1fr; gap: var(--space-10); }
  .gallery { column-count: 2; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__image { order: -1; }
  .hero__image img { aspect-ratio: 16 / 10; }
}
@media (max-width: 560px) {
  .nav__list { gap: var(--space-5); }
  .nav__link { font-size: var(--text-xs); }
  .gallery { column-count: 1; }
  .logo__text { font-size: var(--text-base); }
  .hero__actions { flex-direction: column; align-items: stretch; }
}
