/* ==========================================================
   Theme
   Sizes mirror the original Squarespace site: headings scale
   with the window width (1rem + N vw), body text stays 16px.
   ========================================================== */
:root {
  --bg: #fdf0e6;
  --bg-alt: #ffffff;
  --text: #000000;
  --muted: #555555;
  --accent: #f08e80;
  --line: rgba(0, 0, 0, 0.15);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Page gutter and column positions (as % of window width) */
  --gutter: 4vw;
  --wide-left: 15.5vw;   --wide-width: 69vw;     /* wide centered column */
  --narrow-left: 27vw;   --narrow-width: 46vw;   /* narrow centered column */

  /* Type scale */
  --h1: calc(1rem + 3.6vw);
  --h2: calc(1rem + 2.16vw);
  --h3: calc(1rem + 1.44vw);
  --h4: calc(1rem + 0.24vw);
  --large: calc(1rem + 0.48vw);
  --small: 0.9rem;
  --logo: calc(1rem + 1.2vw);

  --header-h: 95px;
  --section-pad: 84px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }
main p a, main li a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { font-weight: 500; margin: 0 0 1rem; }
h1 { font-size: var(--h1); line-height: 1.232; }
h2 { font-size: var(--h2); line-height: 1.3; }
h3 { font-size: var(--h3); line-height: 1.333; }
h4 { font-size: var(--h4); line-height: 1.4; }
p { margin: 1rem 0; }
p:first-child { margin-top: 0; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
ul { padding-left: 40px; margin: 1rem 0; }
li { margin: 0 0 0.45rem; }
li p { margin: 0; }
blockquote { margin: 1rem 0; padding: 0 40px; }

/* ---------- Utilities ---------- */
.large { font-size: var(--large); line-height: 1.8; }
.small { font-size: var(--small); }
.center { text-align: center; }
.accent { color: var(--accent); }
.white { background: var(--bg-alt); }

/* Column helpers: place a block in the same columns as the original */
.col-full   { margin-left: var(--gutter);      width: calc(100% - 2 * var(--gutter)); }
.col-wide   { margin-left: var(--wide-left);   width: var(--wide-width); }
.col-narrow { margin-left: var(--narrow-left); width: var(--narrow-width); }

/* A page "section" with the original's vertical rhythm */
.section { padding: var(--section-pad) 0; }
.section.tight-top { padding-top: 42px; }
.stack > * + * { margin-top: 32px; }

/* Two-column rows: set the column positions per page with inline style */
.row { display: grid; margin: 0 var(--gutter); column-gap: 2.6vw; align-items: start; }

/* Accent pages (Publications, CV): salmon logo and headings */
.accent-page .site-title,
.accent-page main h2,
.accent-page main h4 { color: var(--accent); }

/* ---------- Header ---------- */
.site-header { height: var(--header-h); display: flex; align-items: center; }
.site-header .bar {
  width: 100%; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-title { font-size: var(--logo); font-weight: 500; line-height: 1.4; text-decoration: none; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 1.1vw; }
.nav a { text-decoration: none; font-size: 16px; padding: 0 0.15em; }
.nav a[aria-current="page"] { border-bottom: 1px solid currentColor; }
.nav a:hover { opacity: 0.6; }
.social { display: flex; gap: 14px; align-items: center; margin-left: 0.8vw; }
.social svg { width: 18px; height: 18px; display: block; fill: currentColor; }

.menu-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: inherit; }
.menu-toggle span { display: block; width: 26px; height: 2px; background: currentColor; margin: 6px 0; }

/* Pages with a full-width banner: header floats over the image in white */
.has-banner .site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 5; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { padding: 60px 0 40px; text-align: center; }
.site-footer .social { justify-content: center; margin: 0 0 10px; }
.site-footer small { color: var(--muted); font-size: 0.8rem; }

/* ---------- Banner (full-width image or color, 66% of window height) ---------- */
.banner {
  position: relative; min-height: 66vh; color: #fff;
  display: flex; align-items: flex-end; padding: var(--header-h) var(--gutter) 51px;
  background: linear-gradient(135deg, #c98f80 0%, #e3b49a 45%, #8fa3a0 100%);
  background-size: cover; background-position: center;
}
.banner::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.18); }
.banner > * { position: relative; width: var(--wide-width); }
.banner.middle { align-items: center; }
.banner h1, .banner h2 { margin: 0; }
.banner p { margin-top: 1.2rem; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 33.1vw 30.4vw; column-gap: 5.4vw; margin-left: var(--wide-left); padding: 85px 0 74px; }
.hero img { width: 100%; aspect-ratio: 424 / 474; object-fit: cover; }
.hero h3 { margin-bottom: 1.6rem; }

/* ---------- Projects overview ---------- */
.experience { display: grid; grid-template-columns: 37.8vw 45.5vw; column-gap: 8.2vw; margin: 0 var(--gutter); padding: var(--section-pad) 0; }
.experience .role p { margin: 0 0 1rem; }
.experience .role p.large { margin-top: 0; }

.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  min-height: 82px; padding: 12px 0; font-size: var(--h3); font-weight: 500; line-height: 1.333;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: ""; width: 10px; height: 10px; flex: none; margin: 0 6px 6px 16px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform 0.2s;
}
.accordion details[open] summary::after { transform: rotate(-135deg); margin-bottom: -6px; }
.accordion details > div { padding: 0 0 22px; }
.accordion details > div p { margin: 0 0 0.3rem; }

/* Portfolio grid: square tiles, title appears on hover */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin: 0 var(--gutter); }
.card { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; text-decoration: none; background: #f3dccb; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card .overlay {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 26px;
  background: rgba(253, 240, 230, 0.9); opacity: 0; transition: opacity 0.25s;
}
.card:hover .overlay, .card:focus-visible .overlay { opacity: 1; }
.card h3 { margin: 0; line-height: 1.4; }
.card.placeholder { display: grid; place-items: center; color: var(--accent); font-size: var(--h2); font-weight: 500; }

/* ---------- Project pages ---------- */
.media-16x9 { position: relative; aspect-ratio: 16 / 9; }
.media-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cover { width: 100%; object-fit: cover; }
figure { margin: 0; }
figcaption { margin-top: 0.6rem; }

.pager { display: flex; justify-content: space-between; gap: 40px; margin: 0 var(--gutter); padding: 60px 3.4vw 40px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; font-size: var(--h3); font-weight: 500; line-height: 1.333; max-width: 42.6vw; }
.pager a:hover { opacity: 0.6; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- CV button ---------- */
.button {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 500; letter-spacing: 0.02em; line-height: 1.5; padding: 19.2px 32px; text-align: center;
}
.button:hover { opacity: 0.85; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gallery img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* ==========================================================
   Phones and small tablets: single column, wider gutters
   ========================================================== */
@media (max-width: 767px) {
  :root {
    --gutter: 6vw;
    --h1: calc(1rem + 3.6vw);
    --h2: calc(1rem + 2.6vw);
    --h3: calc(1rem + 1.6vw);
    --section-pad: 48px;
    --header-h: 76px;
  }
  .col-wide, .col-narrow, .col-full, .banner > * { margin-left: var(--gutter); width: calc(100% - 2 * var(--gutter)); }
  .banner > * { margin-left: 0; width: 100%; }
  .banner { padding-left: var(--gutter); padding-right: var(--gutter); min-height: 52vh; }
  .row, .experience, .hero { grid-template-columns: 1fr !important; row-gap: 28px; margin-left: var(--gutter); margin-right: var(--gutter); }
  .row > * { grid-column: auto !important; margin-top: 0 !important; }
  .hero { padding-top: 24px; }
  .grid { grid-template-columns: 1fr; }
  .card .overlay { opacity: 1; background: linear-gradient(transparent 45%, rgba(253, 240, 230, 0.95) 80%); align-items: flex-end; }
  .pager { padding-left: 0; padding-right: 0; }
  .pager a { max-width: 45%; }

  .menu-toggle { display: block; }
  .site-header { position: relative; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h); z-index: 10;
    flex-direction: column; align-items: flex-start; gap: 14px;
    background: var(--bg); color: var(--text); padding: 20px var(--gutter) 28px; border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { font-size: 1.3rem; }
  .social { margin-left: 0; }
}
@media (min-width: 768px) and (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
