/* ============================================================
   CALA D'EGOS — Ceramics & Material Practices
   Design system built from the official Brand Guidelines v1.
   Bea Calafell · Mallorca · caladegos.com
   ============================================================ */

/* ---- Design tokens ---------------------------------------- */
:root {
  /* Color palette (exact brand hex) */
  --ivory:    #FAF8F7;  /* main background — light, air, silence   */
  --bone:     #F6EDE1;  /* cards, highlighted sections — clay       */
  --stone:    #CEC9C0;  /* dividers, borders — limestone, structure */
  --sepia:    #7A756F;  /* secondary text, captions — trace, memory */
  --charcoal: #4A4846;  /* primary text, headings — matter, depth   */
  --bronze:   #CBAB65;  /* hover / small accents — sunset light     */
  --cove:     #DCEFE8;  /* links, subtle accents — water, calm      */

  /* Typography */
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --max: 1440px;       /* content width      */
  --reading: 680px;    /* reading width      */
  --gutter: clamp(1.5rem, 5vw, 5rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--cove); color: var(--charcoal); }

/* ---- Typography ------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--charcoal);
  margin: 0;
}
h1 { font-size: clamp(3rem, 6vw, 5rem);   line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.15; }
h3 { font-size: 2rem; line-height: 1.2; }

p { margin: 0 0 1.4em; }
.small { font-size: 14px; line-height: 1.7; }

.eyebrow,
.nav a,
.label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow { color: var(--sepia); display: inline-block; margin-bottom: 1.6rem; }

.lead {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.4;
  color: var(--charcoal);
}

/* ---- Layout helpers --------------------------------------- */
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading { max-width: var(--reading); }
.section { padding-block: clamp(5rem, 12vw, 11rem); }
.section--tight { padding-block: clamp(3.5rem, 7vw, 6rem); }
.bg-bone { background: var(--bone); }
.center { text-align: center; }
.divider { height: 1px; background: var(--stone); border: 0; margin: 0; }
.mt-0 { margin-top: 0; }

/* ---- Links / arrow link ----------------------------------- */
.arrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--charcoal);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  border-bottom: 1px solid var(--stone);
  padding-bottom: 0.35rem;
  transition: gap 0.4s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.arrow::after { content: "\2192"; font-size: 1.1em; }
.arrow:hover { gap: 1.1em; color: var(--bronze); border-color: var(--bronze); }

/* ---- Header / Navigation ---------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.1rem, 2vw, 1.8rem) var(--gutter);
  transition: background 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header .logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  line-height: 1;
}
.nav { display: flex; align-items: center; gap: clamp(1.5rem, 2.6vw, 2.8rem); }
.nav a { position: relative; opacity: 0.85; transition: opacity 0.3s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: currentColor; opacity: 0.5;
}

/* Header over a dark hero: light text */
.site-header.is-over-hero { color: var(--ivory); }
.site-header.is-over-hero .logo,
.site-header.is-over-hero .nav a { color: var(--ivory); }
/* Header solid (inner pages, or home after scroll) */
.site-header.is-solid {
  background: color-mix(in srgb, var(--ivory) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--stone);
  color: var(--charcoal);
}
.site-header.is-solid .logo,
.site-header.is-solid .nav a { color: var(--charcoal); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none; border: 0; padding: 0.4rem;
  color: inherit;
  font-family: var(--font-sans); font-weight: 500;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
}

/* ---- Hero ------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--ivory);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.96) brightness(0.98);
}
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(36,42,44,0.55) 0%, rgba(36,42,44,0.12) 42%, rgba(36,42,44,0.18) 100%);
}
.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: var(--gutter);
  padding-bottom: clamp(3rem, 7vw, 6rem);
}
.hero h1 { color: var(--ivory); max-width: 14ch; }
.hero__subtitle {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory);
  opacity: 0.92;
  margin-top: 1.4rem;
}
.hero__scroll {
  position: absolute;
  left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ivory); opacity: 0.7;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
}
.hero__scroll::after {
  content: ""; width: 1px; height: 38px;
  background: linear-gradient(var(--ivory), transparent);
  animation: scrollpulse 2.4s var(--ease) infinite;
}
@keyframes scrollpulse { 0%,100%{opacity:.3;transform:scaleY(.6)} 50%{opacity:.9;transform:scaleY(1)} }

/* ---- Hero (split editorial: text + photo) ----------------- */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 72svh;
}
.hero-split__text {
  background: var(--ivory);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(5rem, 7vw, 7rem) clamp(1.6rem, 5vw, 5.5rem);
}
.hero-split__text .eyebrow { margin-bottom: 1.8rem; }
.hero-split__text h1 { margin-bottom: 1.1rem; }
.hero-split__subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  line-height: 1.3; color: var(--sepia);
  margin-bottom: 2.2rem;
}
.hero-split__text .intro {
  color: var(--sepia); max-width: 44ch; margin-bottom: 2.6rem;
}
.hero-split__links { display: flex; gap: 1.4rem 2rem; flex-wrap: wrap; align-items: center; }
.hero-split__photo {
  position: relative; overflow: hidden;
  background: linear-gradient(to bottom, #929082 0%, #8e8c7e 45%, #d1cebe 100%);
  display: flex; align-items: center; justify-content: center;
}
.hero-split__photo img { width: 100%; height: 100%; object-fit: contain; }
.hero-split__caption {
  position: absolute; left: 0; bottom: 0;
  padding: 1rem clamp(1.2rem, 2.5vw, 2rem) 1.4rem;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--charcoal);
}
@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; min-height: auto; }
  .hero-split__text { padding-top: clamp(6rem, 18vw, 8rem); padding-bottom: 2.5rem; }
  .hero-split__photo { order: 2; min-height: auto; }
  .hero-split__photo img { height: auto; }       /* show full vessel, no crop on mobile */
  .hero-split__caption { position: static; padding: 0.8rem 1.4rem 0; }
}

/* ---- Statement -------------------------------------------- */
.statement { text-align: center; }
.statement .lead { margin-inline: auto; }
.statement .signoff {
  margin-top: 2.4rem; color: var(--sepia);
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
}

/* ---- Work grid (editorial) -------------------------------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head p { margin: 0; color: var(--sepia); max-width: 46ch; }

.work-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.2rem, 2.4vw, 2.4rem);
}
.work { grid-column: span 4; }
.work--wide { grid-column: span 8; }
.work--half { grid-column: span 6; }
.work figure { margin: 0; overflow: hidden; background: var(--bone); }
.work img {
  width: 100%; height: 100%; object-fit: cover;
  aspect-ratio: 4 / 5;
  filter: saturate(0.92);
  transition: transform 1.1s var(--ease), filter 0.6s var(--ease);
}
.work--wide img, .work--landscape img { aspect-ratio: 16 / 11; }
.work:hover img { transform: scale(1.04); filter: saturate(1); }
.work figcaption {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 1rem; color: var(--sepia); font-size: 14px;
}
.work figcaption .t { color: var(--charcoal); }

/* Works on paper (drawings, watercolors): show the whole piece, never crop */
.work figure.is-paper { background: var(--bone); }
.work figure.is-paper img { object-fit: contain; padding: 7%; }
/* Landscape photo (the cove): give it a landscape frame instead of a portrait crop */
.work figure.is-land img { aspect-ratio: 3 / 2; }

/* ---- Feature / full-bleed image + text -------------------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 70vh;
}
.feature__media { overflow: hidden; }
.feature__media img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.feature__media.contain { background: var(--bone); display: flex; align-items: center; justify-content: center; }
.feature__media.contain img { object-fit: contain; min-height: 0; max-height: 72vh; padding: 6%; }
.feature__body {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2.5rem, 7vw, 7rem);
}
.feature--bone .feature__body { background: var(--bone); }
.feature__body h2 { margin-bottom: 1.4rem; }
.feature__body p { color: var(--sepia); max-width: 42ch; }
.feature--reverse .feature__media { order: 2; }

/* Full-bleed band with image background */
.band {
  position: relative; color: var(--ivory);
  min-height: 80vh; display: flex; align-items: center;
  overflow: hidden;
}
.band__media { position: absolute; inset: 0; }
.band__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.band__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(36,42,44,0.5) 0%, rgba(36,42,44,0.12) 55%, transparent 100%);
}
.band__inner { position: relative; max-width: 36rem; }
.band h2 { color: var(--ivory); }
.band p { color: rgba(250,248,247,0.88); }
.band .eyebrow { color: rgba(250,248,247,0.75); }

/* ---- Courses / Learning ----------------------------------- */
.course-list { display: grid; gap: 0; border-top: 1px solid var(--stone); }
.course {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(0,1.6fr) auto;
  gap: clamp(1rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3.2rem) 0;
  border-bottom: 1px solid var(--stone);
}
.course__title { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; }
.course__title .lvl {
  display: block; margin-top: 0.7rem;
  font-family: var(--font-sans); font-weight: 500; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--sepia);
}
.course__desc { font-size: 16px; color: var(--sepia); margin: 0; }
.course__desc .meta {
  display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.2rem;
  font-family: var(--font-sans); font-weight: 500; font-size: 15px; color: var(--charcoal);
}
.course__desc .meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.course__desc .meta .dot { color: var(--bronze); }
.course__action { text-align: right; }

/* ---- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  font-family: var(--font-sans); font-weight: 500;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.95rem 1.8rem;
  background: var(--charcoal); color: var(--ivory);
  border: 1px solid var(--charcoal);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn:hover { background: transparent; color: var(--charcoal); }
.btn--ghost { background: transparent; color: var(--charcoal); }
.btn--ghost:hover { background: var(--charcoal); color: var(--ivory); }
.btn--block { width: 100%; }

/* ---- Forms ------------------------------------------------ */
.form { display: grid; gap: 1.6rem; }
.field { display: grid; gap: 0.5rem; }
.field label {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sepia);
}
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: 16px; color: var(--charcoal);
  background: var(--ivory);
  border: 1px solid var(--stone);
  padding: 0.85rem 1rem;
  border-radius: 0;
  transition: border-color 0.3s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--charcoal);
}
.field textarea { resize: vertical; min-height: 120px; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.form-note { font-size: 13px; color: var(--sepia); }
.form-status {
  display: none; padding: 1rem 1.2rem; background: var(--cove);
  color: var(--charcoal); font-size: 15px; border-left: 2px solid var(--bronze);
}
.form-status.is-visible { display: block; }

.booking-panel { background: var(--bone); padding: clamp(2rem, 4vw, 3.5rem); }

/* ---- Contact mini ----------------------------------------- */
.contact-meta { display: grid; gap: 1.4rem; }
.contact-meta a:hover { color: var(--bronze); }
.contact-meta .label { color: var(--sepia); display: block; margin-bottom: 0.3rem; }

/* ---- Two-column generic ----------------------------------- */
.cols2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem); align-items: start;
}

/* ---- Footer ----------------------------------------------- */
.site-footer {
  background: var(--charcoal); color: var(--ivory);
  padding-block: clamp(3rem, 5vw, 4.5rem);
}
.site-footer a { color: var(--ivory); opacity: 0.82; transition: opacity 0.3s var(--ease); }
.site-footer a:hover { opacity: 1; color: var(--bronze); }
.footer-grid {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 5.5rem);
  align-items: start;
}
.site-footer .logo { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.site-footer .tagline { color: rgba(250,248,247,0.6); margin-top: 1rem; font-size: 14px; }
.footer-col h4 {
  font-family: var(--font-sans); font-weight: 500; color: rgba(250,248,247,0.6);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-bottom {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: 2rem; border-top: 1px solid rgba(250,248,247,0.15);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 13px; color: rgba(250,248,247,0.55);
}

/* ---- Page hero (inner pages) ------------------------------ */
.page-hero { padding-top: clamp(8rem, 14vw, 12rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.page-hero h1 { font-size: clamp(2.6rem, 5vw, 4rem); }
.page-hero p { color: var(--sepia); max-width: 52ch; margin-top: 1.4rem; }

/* ---- Reveal on scroll ------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- Mobile menu overlay ---------------------------------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ivory); color: var(--charcoal);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 1.4rem;
  opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu a { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.4; }
.mobile-menu a:hover { color: var(--bronze); }
.mobile-menu .close {
  position: absolute; top: 1.6rem; right: var(--gutter);
  background: none; border: 0; color: var(--charcoal);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-toggle { display: inline-block; }
  .feature, .cols2 { grid-template-columns: 1fr; }
  .feature--reverse .feature__media { order: 0; }
  .work--wide, .work--half { grid-column: span 12; }
  .work { grid-column: span 6; }
  .course { grid-template-columns: 1fr; gap: 1rem; }
  .course__action { text-align: left; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .field--row { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .work { grid-column: span 12; }
  .hero__scroll { display: none; }
}
