/* ============================================
   Sabali — Isaac Osei Jones
   Wetwood / Light Accent palette, 4-role type system
   ============================================ */

:root {
  /* Wetwood / Light Accent palette */
  --bg: #f5efe4;         /* Light Accent — warm cream ground */
  --bg-alt: #eee3d2;      /* deeper cream for banded surfaces / placeholder tiles */
  --ink: #33241a;         /* Wetwood — deep wet-oak brown, primary text */
  --ink-dim: #7a6a5c;      /* muted warm brown-gray, secondary text */
  --accent: #9c6b3e;      /* warm caramel — bridges Wetwood and the light ground */
  --accent-hover: #7e5530;
  --line: rgba(51, 36, 26, 0.16);

  /* EDIT: URW DIN, Shapiro Base, and Sofia Pro are commercial fonts not on
     Google Fonts — self-host once the licensed files are supplied:
       @font-face { font-family: "URW DIN";    src: url("assets/fonts/URWDIN-Bold.woff2") format("woff2"); font-weight: 700; }
       @font-face { font-family: "Shapiro";    src: url("assets/fonts/ShapiroBase-Light.woff2") format("woff2"); font-weight: 300; }
       @font-face { font-family: "Sofia Pro";  src: url("assets/fonts/SofiaPro-Light.woff2") format("woff2"); font-weight: 300; }
       @font-face { font-family: "Sofia Pro";  src: url("assets/fonts/SofiaPro-Regular.woff2") format("woff2"); font-weight: 400; }
     then swap the family names below. Archivo / Plus Jakarta Sans / Manrope
     stand in for now as the closest free matches. */
  --font-heading: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;   /* URW DIN */
  --font-subtitle: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;           /* Shapiro Base */
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;       /* Sofia Pro */

  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

section[id] { scroll-margin-top: 80px; }

.section { padding: clamp(56px, 9vw, 104px) 24px; }
.section-inner { max-width: var(--max); margin: 0 auto; }

/* First section on a page (no hero) needs extra top padding to clear
   the fixed header. */
section.book-section,
section.portfolio-section { padding-top: clamp(104px, 15vw, 168px); }

.kicker {
  font-family: var(--font-subtitle);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 12px;
}
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h1.page-title { font-size: clamp(2.2rem, 5vw, 3.2rem); }

.subtitle {
  font-family: var(--font-subtitle);
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--ink-dim);
  margin: 14px 0 0;
  max-width: 52ch;
}

/* ---------- Specifications ---------- */
.specs { margin: 26px 0 4px; border-top: 1px solid var(--line); }
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.spec-row dt {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}
.spec-row dd {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  text-align: right;
}

.link-arrow {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
  font-size: 0.92rem;
}
.link-arrow:hover { border-color: var(--accent); color: var(--accent-hover); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 2px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-large { padding: 16px 38px; font-size: 0.95rem; margin-top: 6px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 24px;
  transition: background 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(245, 239, 228, 0.94);
  backdrop-filter: blur(6px);
  padding: 16px 24px;
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; }
.brand-logo { height: 52px; width: auto; display: block; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
}
.main-nav a { color: var(--ink-dim); transition: color 0.15s ease; }
.main-nav a:hover,
.main-nav a[aria-current="page"] { color: var(--ink); }
.nav-ig { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

a:focus-visible,
.btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

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

/* ---------- Two-column sections ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.col-text p { color: var(--ink-dim); max-width: 52ch; }

/* ---------- Rotatable 3D book ----------
   A real cuboid: front, back, spine, page edges, head and tail. Proportions
   follow the printed book (21 x 28 cm), with thickness as a share of width.
   --spin is driven by JS (drag / the buttons below the book). */
.book-viewer {
  --bw: clamp(200px, 40vw, 300px);
  --bh: calc(var(--bw) * 28 / 21);
  /* Spine thickness, measured off the spine photo: the flattened spine is
     23.8x longer than it is wide, so at 21x28cm the book is ~1.2cm thick.
     Keeping this exact means the spine photo renders undistorted. */
  --bt: calc(var(--bw) * 0.056);
  --spin: 20deg;
  --tilt: -4deg;
}

.book-stage {
  position: relative;
  height: calc(var(--bh) + 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1900px;
  cursor: grab;
  touch-action: pan-y;              /* horizontal drag rotates, vertical still scrolls */
  outline-offset: 6px;
}
.book-stage.is-dragging { cursor: grabbing; }

.book {
  position: relative;
  width: var(--bw);
  height: var(--bh);
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt)) rotateY(var(--spin));
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.book.is-dragging { transition: none; }

.book-face {
  position: absolute;
  backface-visibility: hidden;
  background: var(--bg-alt);
}

/* Covers */
.book-front,
.book-back {
  top: 0; left: 0;
  width: var(--bw);
  height: var(--bh);
  object-fit: cover;
}
.book-front { transform: translateZ(calc(var(--bt) / 2)); }
.book-back  { transform: rotateY(180deg) translateZ(calc(var(--bt) / 2)); }

/* Spine (left edge) and fore-edge pages (right edge) */
.book-spine,
.book-pages {
  top: 0;
  left: calc((var(--bw) - var(--bt)) / 2);
  width: var(--bt);
  height: var(--bh);
  overflow: hidden;
}
.book-spine {
  transform: rotateY(-90deg) translateZ(calc(var(--bw) / 2));
  background: var(--ink);          /* fallback if the photo fails to load */
}
.book-spine-img { width: 100%; height: 100%; object-fit: cover; }
/* Edge shading so the spine doesn't read as a flat sticker */
.book-spine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.22) 0%,
    rgba(0, 0, 0, 0) 26%,
    rgba(0, 0, 0, 0) 74%,
    rgba(0, 0, 0, 0.24) 100%);
  pointer-events: none;
}

.book-pages {
  transform: rotateY(90deg) translateZ(calc(var(--bw) / 2));
  background:
    repeating-linear-gradient(90deg,
      rgba(51, 36, 26, 0.16) 0px,
      rgba(51, 36, 26, 0.16) 0.5px,
      transparent 0.5px,
      transparent 2.5px),
    linear-gradient(90deg, #cdbfab 0%, #f3ece0 30%, #fbf7ef 60%, #d8ccba 100%);
}

/* Head and tail — the page block seen from above and below */
.book-top,
.book-bottom {
  left: 0;
  top: calc((var(--bh) - var(--bt)) / 2);
  width: var(--bw);
  height: var(--bt);
  background:
    repeating-linear-gradient(0deg,
      rgba(51, 36, 26, 0.14) 0px,
      rgba(51, 36, 26, 0.14) 0.5px,
      transparent 0.5px,
      transparent 2.5px),
    linear-gradient(180deg, #e7ddcc 0%, #fbf7ef 45%, #d9cdbb 100%);
}
.book-top    { transform: rotateX(90deg) translateZ(calc(var(--bh) / 2)); }
.book-bottom { transform: rotateX(-90deg) translateZ(calc(var(--bh) / 2)); }

/* Ground shadow, outside the 3D context so it stays put */
.book-shadow {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: calc(var(--bw) * 0.82);
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(51, 36, 26, 0.34) 0%,
    rgba(51, 36, 26, 0.14) 45%,
    transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.book-controls {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
/* Single affordance: signals the book turns, and steps through the views. */
.book-rotate {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.book-rotate:hover { color: var(--ink); border-color: var(--ink-dim); }
.book-rotate svg { transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1); }
.book-rotate:hover svg { transform: rotate(60deg); }

.book-rotate:focus-visible,
.book-stage:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .book-rotate svg { transition: none; }
  .book-rotate:hover svg { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .book { transition: none; }
}

/* ---------- Portfolio / gallery ---------- */
.portfolio-intro { color: var(--ink-dim); max-width: 60ch; }

.gallery-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

/* ---------- Framed print ----------
   Proportions taken from the supplied frame mockup: black moulding at ~1.9%
   of the frame's outer width and a white mat at ~8.4%, even on all four
   sides. No fixed aspect ratio, so portrait and landscape keep their shape. */
.framed { margin: 0; }

.framed-mat {
  background: #ffffff;
  padding: 7.5%;                                   /* mat board */
  border: clamp(5px, 0.7vw, 10px) solid #14120f;   /* moulding */
  box-shadow: 0 20px 34px -20px rgba(51, 36, 26, 0.5);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.framed-photo { width: 100%; height: auto; display: block; }

.framed:hover .framed-mat {
  transform: translateY(-3px);
  box-shadow: 0 28px 44px -22px rgba(51, 36, 26, 0.55);
}

.framed-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 14px;
}
.framed-title {
  font-family: var(--font-subtitle);
  font-weight: 300;
  font-style: italic;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.framed-buy {
  margin-left: auto;              /* sits right, with or without a title */
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--accent-hover);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
  white-space: nowrap;
}
.framed-buy:hover { border-bottom-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  .framed-mat, .framed:hover .framed-mat { transition: none; transform: none; }
}

/* Shown while a category has no photos yet; delete it once tiles are added. */
.coming-soon {
  margin-top: 56px;
  padding: 64px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-subtitle);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- Contact ---------- */
.contact-block {
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.contact-label {
  font-family: var(--font-subtitle);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 6px;
}
.contact-label + * + .contact-label { margin-top: 30px; }

.contact-primary {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact-primary:hover { color: var(--accent-hover); border-bottom-color: currentColor; }

/* Number and its WhatsApp shortcut sit on one line. Aligned on the box rather
   than the baseline so the icon centres against the digits at any clamp size. */
.contact-line {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.contact-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact-wa:hover { color: var(--accent-hover); border-color: var(--accent-hover); }

.contact-secondary {
  display: block;
  width: fit-content;
  margin-bottom: 6px;
  font-size: 1rem;
  color: var(--accent-hover);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.contact-secondary:hover { border-bottom-color: currentColor; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer-ig { display: inline-flex; color: var(--ink-dim); }
.footer-ig:hover { color: var(--accent); }

/* Build credit — deliberately quiet; present but never competing. */
.footer-credit {
  margin: 18px 0 0;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  opacity: 0.7;
}
.footer-credit a {
  color: inherit;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-credit a:hover { color: var(--accent); border-bottom-color: currentColor; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transition: opacity 0.6s ease; }
.reveal.in-view { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 300px);
    background: var(--bg-alt);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .main-nav.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

@media (max-width: 480px) {
  .btn { text-align: center; }
}
