/* ==========================================================
   Thessa Studio website stylesheet
   Brand: deep navy, cream and sandy cream, with the shell
   pattern as an accent. Dark navy page so the work pops.

   FONTS
   - Headings: Open Sauce (download free from opensaucefonts.com,
     put the .woff2 files in a /fonts folder; see @font-face below)
   - Accent serif: Marcellus (Google Fonts)
   - Body: Canva Sans (only in Canva, so Albert Sans stands in)

   Add to the <head> of every page:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Marcellus&family=Albert+Sans:wght@400;600&display=swap" rel="stylesheet">
   <link rel="stylesheet" href="styles.css">
   ========================================================== */

/* ---------- 0. Open Sauce (self-hosted) ---------- */
@font-face {
  font-family: "Open Sauce";
  src: local("Open Sauce One Medium"), local("OpenSauceOne-Medium"),
       url("fonts/OpenSauceOne-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Open Sauce";
  src: local("Open Sauce One Bold"), local("OpenSauceOne-Bold"),
       url("fonts/OpenSauceOne-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- 1. Brand tokens (change the look here) ---------- */
:root {
  /* Brand colours */
  --navy: #16195b;        /* deep navy: page background */
  --navy-soft: #2b276d;   /* pattern navy: panels, placeholders, fields */
  --navy-deep: #0d0f3a;   /* darker navy: header and footer */
  --cream: #fff6e5;       /* text, buttons */
  --sand: #ddbca1;        /* sandy cream: accents, secondary text */

  /* Roles (the rest of the file uses these) */
  --bg: var(--navy);
  --surface: var(--navy-soft);
  --line: #4a4a8a;        /* dividers and borders */
  --text: var(--cream);
  --text-soft: var(--sand);   /* 8:1 on navy */
  --accent: var(--cream);     /* buttons and links */
  --accent-ink: var(--navy);  /* text on a cream button */
  --focus: var(--sand);       /* keyboard focus outline */

  --font-head: "Open Sauce", "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Marcellus", Georgia, "Times New Roman", serif;
  --font-body: "Canva Sans", "Albert Sans", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: 1.875rem;
  --step-3: clamp(2.25rem, 4vw + 1rem, 3.75rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 3rem;
  --space-5: clamp(3rem, 8vw, 6rem);
  --max: 1280px;

  --radius-btn: 999px;    /* pill-shaped buttons. Try 8px for softer squares */
  --radius-img: 16px;     /* image frames and form fields */

  /* Uniform image frames: change these to resize every image at once */
  --frame-ratio: 16 / 9;  /* cards, sliders, in-context images */
  --hero-ratio: 21 / 9;   /* wide banner at the top of each project */
}

/* ---------- Rounded corners ---------- */
.btn,
.filters button,
.focus-list li {
  border-radius: var(--radius-btn);
}

.card .thumb,
.project-hero,
.process img,
.details img,
.context img,
.slide img,
.about img,
.video,
.hero {
  border-radius: var(--radius-img);
}

.form input,
.form textarea {
  border-radius: var(--radius-img);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 var(--space-2); max-width: 65ch; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-color: var(--sand); text-decoration-thickness: 2px; }
a:hover { color: var(--sand); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-5); }
.section + .section { border-top: 1px solid var(--line); }

.caption, .meta {
  font-size: var(--step--1);
  color: var(--text-soft);
}

/* Marcellus is the accent serif for statements and quotes */
.serif { font-family: var(--font-serif); font-weight: 400; }

/* Shell pattern panel. Export the pattern from your identity
   board as images/pattern.png (navy with cream line art). */
.pattern {
  background-color: var(--navy-soft);
  background-image: url("images/pattern.png");
  background-size: 360px;
  color: var(--cream);
}

/* ---------- 3. Header and navigation ---------- */
.site-header {
  background: var(--navy-deep);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: 1rem;
}
.logo { display: inline-flex; align-items: center; text-decoration: none; }
/* The logo is navy, so this turns it cream on the dark header */
.logo img { height: 56px; width: auto; filter: brightness(0) invert(1); }
.nav { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.nav a {
  color: var(--text-soft);
  text-decoration: none;
  padding-block: 0.5rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--cream); border-bottom-color: var(--sand); }
.nav a[aria-current="page"] {
  color: var(--cream);
  border-bottom-color: var(--cream);
}

/* ---------- 4. Hero (home page) ---------- */
.hero {
  position: relative;
  min-height: min(40vh, 380px);   /* half the original height */
  background: var(--surface);
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.statement { padding-block: var(--space-5) var(--space-4); }
.statement p {
  font-family: var(--font-serif);
  font-size: var(--step-2);
  line-height: 1.4;
  max-width: 34ch;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: 600 var(--step--1)/1.4 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover,
.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-solid:hover { background: var(--sand); border-color: var(--sand); color: var(--accent-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Round icon buttons (social links) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-btn);
  color: var(--accent);
  transition: background-color 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--accent); color: var(--accent-ink); }
.btn-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 6. Work grid ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}
.filters button {
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}
.filters button:hover { color: var(--cream); border-color: var(--sand); }
.filters button[aria-pressed="true"] {
  background: var(--cream);
  border-color: var(--cream);
  color: var(--navy);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.card { display: block; color: inherit; text-decoration: none; }
.card .thumb {
  aspect-ratio: var(--frame-ratio);
  width: 100%;
  object-fit: cover;
  background: var(--surface);
  margin-bottom: 0.75rem;
}
.card h3 {
  margin: 0 0 0.15rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--step-1);
}
.card p {
  margin: 0;
  font-size: var(--step--1);
  color: var(--text-soft);
}
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--sand); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.card:hover .thumb { opacity: 0.88; }

/* ---------- 7. Project page ---------- */
.project-hero {
  width: 100%;
  aspect-ratio: var(--hero-ratio);
  max-height: 70vh;
  object-fit: cover;
  background: var(--surface);
}

.brief {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}
.brief dl { margin: 0; }
.brief dt { font-size: var(--step--1); color: var(--text-soft); }
.brief dd { margin: 0 0 var(--space-2); }

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.process figure, .details figure, .context figure { margin: 0; }
.process img, .details img, .context img {
  width: 100%;
  background: var(--surface);
  object-fit: cover;
}
.process img { aspect-ratio: 1 / 1; }
.details img { aspect-ratio: 4 / 3; }
.context img {
  aspect-ratio: var(--frame-ratio);
  max-height: 75vh;
  object-fit: contain;   /* whole image shown, nothing cropped */
}
figcaption {
  margin-top: 0.5rem;
  font-size: var(--step--1);
  color: var(--text-soft);
}

.links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.video {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  background: var(--surface);
}


/* ---------- Image sliders (Process and Details) ---------- */
.slides {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: var(--radius-img);
}
.slides::-webkit-scrollbar { display: none; }
.slides:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
}
/* A wide frame, with the whole image shown inside it (nothing cropped) */
.slide img {
  width: 100%;
  aspect-ratio: var(--frame-ratio);
  max-height: 75vh;
  object-fit: contain;
  background: var(--surface);
}
.slide figcaption { margin-top: 0.75rem; }

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.slider-count { font-size: var(--step--1); color: var(--text-soft); min-width: 4ch; text-align: center; }
.slider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.slider-btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.slider-btn:disabled { opacity: 0.35; cursor: default; }
.slider-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Instagram embed */
.embed { max-width: 540px; }
.embed .instagram-media {
  margin: 0 !important;
  border-radius: var(--radius-img) !important;
}

/* Social embeds on the home page */
.links { align-items: start; }
.ig-frame {
  width: 100%;
  height: 560px;
  border: 0;
  border-radius: var(--radius-img);
  background: #fff;
}

/* Patreon support panel */
.support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-img);
}
.support h3 { margin: 0 0 0.25rem; }
.support p { margin: 0; }

/* ---------- 8. About ---------- */
.about {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-4);
  align-items: start;
}
.about img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--surface);
}
.focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}
.focus-list li {
  padding: 0.3rem 0.9rem;
  background: var(--sand);
  color: var(--navy);
  font-size: var(--step--1);
  font-weight: 600;
}

/* ---------- 9. Contact form ---------- */
.form {
  display: grid;
  gap: var(--space-2);
  max-width: 560px;
}
.form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--step--1);
  color: var(--text-soft);
}
.form input,
.form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--navy-soft);
  border: 1px solid var(--line);
  color: var(--cream);
  font: inherit;
}
.form textarea { min-height: 160px; resize: vertical; }
.form input:focus-visible,
.form textarea:focus-visible {
  outline: 3px solid var(--focus);
  border-color: var(--sand);
}

/* ---------- 10. Footer (darker navy block, cream text) ---------- */
.site-footer {
  margin-top: var(--space-5);
  background: var(--navy-deep);
  border-top: 1px solid var(--line);
  color: var(--cream);
  font-size: var(--step--1);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-4);
}
.site-footer a { color: var(--cream); text-decoration-color: var(--sand); }
.site-footer a:hover { color: var(--sand); }
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- 11. Responsive ---------- */
@media (max-width: 960px) {
  .grid, .details { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .brief, .about { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid, .details, .process, .links { grid-template-columns: 1fr; }
  .nav { gap: var(--space-2); }
  .hero { min-height: 30vh; }
  :root { --hero-ratio: 16 / 9; }
}

/* ---------- 12. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html, .slides { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ==========================================================
   13. Work page: landscape page-turning book
   Used by work.html (screens 1000px and wider). Below that,
   the normal card grid shows instead.
   Tweak the page shape with --page-ratio (smaller = wider).
   ========================================================== */
/* ---------- Landscape page-turning book (Work page, screens 1000px and wider) ---------- */
.work-book { display: none; }
.js-book .work-book { display: block; }
.js-book .work-grid { display: none; }
@media (max-width: 999px) {
  .js-book .work-book { display: none; }
  .js-book .work-grid { display: block; }
}

.work-book {
  --page-w: clamp(400px, 46vw, 592px);
  --page-ratio: 0.625;   /* page height / page width. 0.625 = a 16:10 landscape page. Smaller = wider, flatter book */
  --page-h: calc(var(--page-w) * var(--page-ratio));
  padding-block: var(--space-3) var(--space-4);
}
.book-stage { display: flex; justify-content: center; padding: var(--space-3) 0; }

.book {
  position: relative;
  width: calc(var(--page-w) * 2);
  height: var(--page-h);
  perspective: 2600px;
  transition: transform 0.7s ease;
}
.book:focus-visible { outline: 3px solid var(--focus); outline-offset: 12px; border-radius: 14px; }
.book.is-closed { transform: translateX(calc(var(--page-w) / -2)); }
/* one soft shadow under the whole book */
.book::before {
  content: "";
  position: absolute;
  inset: 2% 0 -1%;
  border-radius: 14px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.4);
  z-index: -1;
  transition: left 0.7s ease;
}
.book.is-closed::before { left: 50%; }

.book-base, .leaf { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; }
.book-base {
  z-index: 0;
  border-radius: 0 14px 14px 0;
  background: var(--navy-soft);
  color: var(--cream);
  padding: 6%;
}
.leaf {
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.45, 0.05, 0.25, 1);
}
.leaf.flipped { transform: rotateY(-180deg); }

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--navy-deep);
  color: var(--cream);
  cursor: pointer;
}
.face.front { border-radius: 0 14px 14px 0; }
.face.back  { transform: rotateY(180deg); border-radius: 14px 0 0 14px; }
.face.cover { background: var(--navy-soft); padding: 6%; }
.face.endleft, .face.plate-face { background: var(--navy-soft); padding: 6% 9% 6% 6%; }
/* shading next to the spine */
.face::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.face.front::after { background: linear-gradient(to right, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 7%); }
.face.back::after  { background: linear-gradient(to left,  rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 7%); }

/* RIGHT page: the project picture fills the whole landscape page, edge to edge */
.shot { position: absolute; inset: 0; background: var(--navy-deep); }
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fills the page. Very wide or very tall pictures switch to "contain" in the script */
  object-position: center;
  -webkit-user-drag: none;
  user-select: none;
}
.shot.is-contain img { object-fit: contain; }

/* LEFT page: a quiet title plate, so the picture opposite stays the focus */
.page { height: 100%; display: flex; flex-direction: column; }
.plate { justify-content: space-between; }
.plate-role { margin: 0; font-size: 0.875rem; color: var(--sand); }
.plate-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  color: var(--cream);
  overflow-wrap: anywhere;
}
.plate-sub { margin: 0; max-width: 34ch; font-size: 0.95rem; color: var(--cream); opacity: 0.85; }

.page-cover, .page-end {
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-align: center;
  border: 2px solid var(--sand);
  border-radius: 8px;
  padding: 1.25rem;
}
.page-cover img, .page-end img { width: 40%; max-height: 36%; object-fit: contain; filter: brightness(0) invert(1); }
.cover-title { font-family: var(--font-serif); font-size: clamp(1.4rem, 2.4vw, 2.2rem); line-height: 1.15; }
.cover-hint { font-size: 0.875rem; color: var(--sand); margin: 0; }

.endleft .pg-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.3rem, 2.1vw, 2.3rem); line-height: 1.1; margin: 0 0 0.8rem; color: var(--cream); }
.pg-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; }
.pg-links a { color: var(--cream); text-decoration-color: var(--sand); }
.pg-links a:hover { color: var(--sand); }
.face :focus-visible, .book-base :focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

.book-link {
  display: inline-block;
  align-self: flex-start;
  padding: 0.7rem 1.3rem;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy);
  font: 600 0.875rem/1.4 var(--font-body);
  text-decoration: none;
  cursor: pointer;
}
.book-link:hover { background: var(--sand); color: var(--navy); }

.book-controls { margin-top: var(--space-2); }

/* project details sit under the book */
.book-info {
  width: calc(var(--page-w) * 2);
  margin: var(--space-3) auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2) var(--space-4);
  align-items: start;
  min-height: 8rem;
}
.info-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2.3rem); margin: 0 0 0.25rem; }
.info-desc { margin: 0; max-width: 60ch; }
.info-side { display: grid; gap: 1rem; justify-items: start; }
.info-meta { margin: 0; font-size: 0.9rem; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; }
.info-meta dt { color: var(--text-soft); }
.info-meta dd { margin: 0; }
/* read out by screen readers; the title already shows on the book's left page */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.book-help { text-align: center; margin: var(--space-2) auto 0; font-size: var(--step--1); color: var(--text-soft); }

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