/* ---------- Colours ---------- */
:root, [data-theme="dark"] {
  --bg: #16110E;
  --band: #1F1814;
  --fg: #EFE4D6;
  --muted: #BCAE9E;
  --link: #D9C4A0;     /* beige */
  --amber: #D49568;    /* muted amber */
  --pop-bg: #2A201A;
  --pop-fg: #EFE4D6;
  --line: #2E2621;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #EEE5D8;
  --band: #E4D8C6;
  --fg: #2B1A1C;
  --muted: #5E4B47;
  --link: #6E4A2C;
  --amber: #8C421E;
  --pop-bg: #2B1A1C;
  --pop-fg: #F3EADF;
  --line: #D6C8B6;
  color-scheme: light;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  transition: background .25s, color .25s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 4px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, .brand, .post-title, .c-title, .cv-title, .e-title, .tabs button {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
}
h1 { margin: 0; font-size: clamp(48px, 7vw, 76px); line-height: 1; }
h2 { margin: 0; font-size: clamp(32px, 4vw, 40px); line-height: 1.1; }
.label {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.amber { color: var(--amber); }
.amber-link { color: var(--amber); font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--bg); padding: 8px 12px; z-index: 50; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .wrap { padding: 0 20px; } body { font-size: 16px; } }

/* Full-width tonal strip without breaking the centred column */
.band {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
}

/* Both languages are in the page; show the selected one */
[data-lang="en"] .l-cy, [data-lang="cy"] .l-en { display: none; }

/* ---------- Header ---------- */
.nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 26px; color: var(--fg); text-decoration: none; margin-right: auto; }
.nav nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.nav nav a { color: var(--fg); text-decoration: none; font-size: 15px; padding: 10px 2px; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--link); }
.toggles { display: flex; align-items: center; gap: 8px; padding-left: 16px; border-left: 1px solid var(--line); }
.icon-btn, .lang-btn {
  height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 22px;
  color: var(--fg); cursor: pointer; font: 13px Inter, system-ui, sans-serif;
}
.lang-btn { padding: 0 14px; gap: 4px; color: var(--muted); }
[data-lang="en"] .opt-en, [data-lang="cy"] .opt-cy { color: var(--fg); }
[data-theme="dark"] .sun, [data-theme="light"] .moon { display: none; }
.learner { font-size: 12px; font-style: italic; color: var(--muted); }
@media (max-width: 760px) {
  .toggles { border-left: 0; padding-left: 0; }
}

/* ---------- Home ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 64px; padding: 80px 0; align-items: flex-start; }
.portrait { margin: 0; flex: 1 1 300px; max-width: 400px; display: flex; flex-direction: column; gap: 10px; }
.portrait img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.hero-text { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.bio p { margin: 0 0 18px; font-size: 18px; line-height: 1.7; max-width: 620px; }

.tip {
  position: relative; display: inline; font: inherit; color: inherit;
  background: none; border: 0; padding: 0; margin: 0; cursor: help; text-align: inherit;
  text-decoration: underline dotted var(--amber); text-underline-offset: 5px; text-decoration-thickness: 2px;
}
.tip .pop {
  position: absolute; left: 0; top: calc(100% + 12px); z-index: 10;
  width: min(280px, 80vw); padding: 14px 16px; border-radius: 6px;
  background: var(--pop-bg); color: var(--pop-fg);
  font: 14px/1.5 Inter, system-ui, sans-serif; font-style: normal; text-align: left;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s, transform .18s;
}
.tip:hover .pop, .tip:focus .pop { opacity: 1; visibility: visible; transform: none; }

.photos-strip { padding: 72px 0; display: flex; flex-direction: column; gap: 28px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { font-size: 15px; }
.strip { display: flex; flex-wrap: wrap; gap: 24px; }
.strip figure { margin: 0; flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.split { display: flex; flex-wrap: wrap; gap: 64px; padding: 80px 0; }
.now { flex: 1 1 280px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 24px; }
.now ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.writing { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; scroll-margin-top: 24px; }
.posts { display: flex; flex-direction: column; gap: 28px; }
.post { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; text-decoration: none; color: var(--fg); }
.post img, .cover-blank { flex: 0 0 140px; width: 140px; aspect-ratio: 3 / 2; object-fit: cover; background: var(--band); }
.post-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-title { font-size: 26px; line-height: 1.15; }
.post-sub { font-size: 15px; line-height: 1.55; color: var(--muted); }
.read { font-size: 14px; color: var(--amber); }
.post:hover .post-title { color: var(--link); }

/* ---------- Page heads ---------- */
.page-head { display: flex; flex-direction: column; gap: 20px; padding: 72px 0 40px; }
.page-head.row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; }
.intro { margin: 0; max-width: 620px; font-size: 18px; line-height: 1.7; }

/* ---------- Photography ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 36px; padding-bottom: 8px; }
.tabs button {
  height: 48px; padding: 0 2px; background: none; border: 0;
  border-bottom: 2px solid transparent; color: var(--muted);
  font-size: 28px; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--amber); }
.book { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding: 28px 0; margin-top: 24px; }
.book p { margin: 0; max-width: 560px; color: var(--muted); }
.gallery { columns: 3 300px; column-gap: 16px; padding: 32px 0 72px; }
.shot { display: block; width: 100%; padding: 0; margin: 0 0 16px; border: 0; background: none; cursor: zoom-in; break-inside: avoid; }
.shot img { width: 100%; transition: opacity .2s; }
.shot:hover img { opacity: .85; }

dialog#lightbox {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh;
  color: #EFE4D6;
}
dialog#lightbox::backdrop { background: rgba(10, 8, 6, .94); }
dialog#lightbox img { max-width: 96vw; max-height: 86vh; width: auto; margin: 0 auto; }
dialog#lightbox .label { text-align: center; margin: 12px 0 0; color: #BCAE9E; }
.lb-close {
  position: fixed; top: 16px; right: 16px; width: 48px; height: 48px;
  background: none; border: 0; color: #EFE4D6; font-size: 32px; cursor: pointer;
}

/* ---------- CV ---------- */
.current { padding: 48px 0; display: flex; flex-direction: column; gap: 20px; }
.current-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 3fr); align-items: baseline; gap: 4px 24px; padding: 10px 0; }
.c-title { font-size: 26px; line-height: 1.2; }
.c-org { font-size: 15px; color: var(--muted); }
.c-dates { text-align: right; }
@media (max-width: 760px) { .current-row { grid-template-columns: 1fr; } .c-dates { text-align: left; } }
.c-dates { font-size: 13px; color: var(--amber); }

.cv-sections { display: flex; flex-direction: column; gap: 8px; padding: 48px 0 96px; }
.cv-toggle {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%; min-height: 88px; padding: 0; background: none; border: 0;
  color: var(--fg); text-align: left; cursor: pointer;
}
.cv-title { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; }
.sign { font-size: 26px; color: var(--amber); width: 20px; text-align: center; }
.cv-body { padding: 8px 0 40px; margin-left: min(8vw, 96px); }
.entry { display: flex; flex-wrap: wrap; gap: 8px 40px; padding: 20px 0; }
.e-dates { flex: 0 0 200px; font-size: 13px; line-height: 1.5; color: var(--amber); padding-top: 6px; }
.e-main { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.e-title { font-size: 24px; line-height: 1.2; }
.e-org { font-size: 15px; color: var(--muted); }
.e-sub { font-size: 13px; color: var(--muted); }
.e-main ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; max-width: 680px; }

/* ---------- Footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 48px 0 56px; font-size: 15px; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 24px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* On phones, lead with the words, then the portrait */
@media (max-width: 760px) {
  .hero { gap: 40px; padding: 48px 0; }
  .hero-text { order: -1; }
}
