/* =========================================================================
   daraobeirne.xyz - shared design system
   Palette and type carried over from the approved hero mockup:
   navy ground, warm cream text, cool-blue + gold accents, Fraunces + Inter.
   ========================================================================= */

/* ----- Design tokens ----- */
:root {
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;

  --space-section: 112px;       /* generous vertical breathing room (desktop) */
  --maxw: 1080px;
  --maxw-prose: 720px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme (default): matches the mockup ground */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1224;
  --bg-grad-top: #0B1224;
  --bg-grad-bottom: #070C18;
  --surface: #131B33;
  --surface-2: #182241;
  --border: rgba(244, 239, 228, 0.10);
  --border-strong: rgba(244, 239, 228, 0.18);

  --text: #E8E2D2;
  --text-strong: #F4EFE4;
  --text-muted: #9A93808;
  --text-muted: #9A9380;
  --text-dim: #C7C0AD;

  --cool: #7FB8E8;
  --cool-soft: #84B3D4;
  --cool-bg: rgba(127, 184, 232, 0.16);
  --cool-border: rgba(127, 184, 232, 0.38);

  --gold: #D8B98A;
  --gold-text: #F0DCB6;
  --gold-bg: rgba(216, 185, 138, 0.16);
  --gold-border: rgba(216, 185, 138, 0.38);

  --nav-bg: rgba(11, 18, 36, 0.70);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Light theme */
[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --bg-grad-top: #fafafa;
  --bg-grad-bottom: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --border: rgba(20, 24, 38, 0.10);
  --border-strong: rgba(20, 24, 38, 0.16);

  --text: #2A2E3A;
  --text-strong: #14161f;
  --text-muted: #6B7280;
  --text-dim: #4B5160;

  --cool: #2F6FA6;
  --cool-soft: #2F6FA6;
  --cool-bg: rgba(47, 111, 166, 0.10);
  --cool-border: rgba(47, 111, 166, 0.28);

  --gold: #9A7B3F;
  --gold-text: #7A5E26;
  --gold-bg: rgba(154, 123, 63, 0.12);
  --gold-border: rgba(154, 123, 63, 0.30);

  --nav-bg: rgba(250, 250, 250, 0.72);
  --shadow: 0 24px 70px rgba(20, 24, 38, 0.14);
  --shadow-sm: 0 8px 28px rgba(20, 24, 38, 0.10);
}

/* ----- Base ----- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-grad-bottom) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.serif { font-family: var(--serif); font-weight: 500; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--text-strong); line-height: 1.08; }

::selection { background: var(--gold-bg); color: var(--text-strong); }

/* ----- Layout helpers ----- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.prose { max-width: var(--maxw-prose); }
.section { padding: var(--space-section) 0; }
.section-tight { padding: calc(var(--space-section) * 0.6) 0; }

.eyebrow {
  font-size: 11px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--cool-soft); margin: 0 0 16px; font-weight: 500;
}

.lede { font-size: 18px; color: var(--text-dim); line-height: 1.7; }

.muted { color: var(--text-muted); }

/* ----- Top navigation ----- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 0.5px solid var(--border);
}
.topnav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-family: var(--serif); font-weight: 500; font-size: 16px; letter-spacing: 0.06em; color: var(--text-strong); }
.brand .dot { color: var(--gold); }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  font-size: 13.5px; color: var(--text-dim); letter-spacing: 0.02em;
  position: relative; padding: 4px 0; transition: color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text-strong); }
.nav-links a.active { color: var(--text-strong); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--gold); border-radius: 2px;
}

.nav-right { display: flex; align-items: center; gap: 18px; }

/* Theme toggle */
.theme-toggle {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 999px; border: 0.5px solid var(--border-strong);
  background: transparent; color: var(--text-dim); cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.theme-toggle:hover { color: var(--text-strong); border-color: var(--gold-border); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: none; width: 38px; height: 34px; border: 0.5px solid var(--border-strong);
  border-radius: 8px; background: transparent; color: var(--text-dim); cursor: pointer;
  place-items: center;
}
.hamburger svg { width: 18px; height: 18px; }

/* Mobile sheet */
.mobile-sheet {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: none; flex-direction: column; padding: 24px 28px;
}
.mobile-sheet.open { display: flex; }
.mobile-sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.mobile-sheet a {
  font-family: var(--serif); font-size: 30px; color: var(--text-strong);
  padding: 14px 0; border-bottom: 0.5px solid var(--border);
}
.sheet-close { background: transparent; border: 0; color: var(--text-dim); cursor: pointer; }
.sheet-close svg { width: 24px; height: 24px; }

/* ----- Buttons & pills ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 400;
  padding: 11px 20px; border-radius: 999px; cursor: pointer;
  border: 0.5px solid var(--border-strong); background: transparent; color: var(--text-strong);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.btn:hover { border-color: var(--gold-border); transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #15110A; border-color: transparent; }
.btn-primary:hover { background: var(--gold-text); }
.btn svg { width: 16px; height: 16px; }

.pills { display: flex; gap: 9px; flex-wrap: wrap; }
.pill {
  font-size: 11.5px; padding: 5px 12px; border-radius: 999px;
  backdrop-filter: blur(8px); letter-spacing: 0.01em;
}
.pill-cool { background: var(--cool-bg); color: var(--cool-soft); border: 0.5px solid var(--cool-border); }
.pill-warm { background: var(--gold-bg); color: var(--gold-text); border: 0.5px solid var(--gold-border); }

.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-dim); border: 0.5px solid var(--border);
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----- Cards ----- */
.card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
a.card:hover, .card.hoverable:hover { transform: translateY(-3px); border-color: var(--gold-border); }

.card-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--cool-bg); color: var(--cool-soft); margin-bottom: 16px;
}
.card-icon svg { width: 19px; height: 19px; }

.card-arrow { color: var(--gold); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; margin-top: 14px; }

/* Grids */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* Section heading block */
.section-head { margin-bottom: 44px; }
.section-head h2 { font-size: 36px; margin: 0 0 14px; }
.section-head p { margin: 0; max-width: 560px; }

/* ----- Map thumbnail (CSS-rendered, no external tiles) ----- */
.map-thumb {
  aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden;
  position: relative; border: 0.5px solid var(--border);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(127,184,232,0.12), transparent 55%),
    radial-gradient(100% 90% at 90% 90%, rgba(216,185,138,0.12), transparent 55%),
    var(--surface-2);
}
.map-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ----- App screenshot thumbnail (landscape, with SVG glyph fallback behind) ----- */
.shot-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius-sm); border: 0.5px solid var(--border);
  background: var(--surface-2);
}
.shot-thumb .shot-fallback { position: absolute; inset: 0; }
.shot-thumb .shot-fallback svg { width: 100%; height: 100%; }
.shot-thumb .shot-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
}
a.card:hover .shot-img { transform: scale(1.02); }
.shot-img { transition: transform 0.4s var(--ease); }

/* ----- Read-more link ----- */
.read-more {
  display: inline-flex; align-items: center; gap: 7px; color: var(--gold);
  font-size: 14.5px; transition: gap 0.2s var(--ease);
}
.read-more:hover { gap: 11px; }

/* ----- Footer ----- */
.site-footer { border-top: 0.5px solid var(--border); padding: 64px 0 48px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.footer-social { display: flex; gap: 14px; margin-top: 18px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center;
  border: 0.5px solid var(--border-strong); color: var(--text-dim);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.footer-social a:hover { color: var(--gold-text); border-color: var(--gold-border); }
.footer-social svg { width: 17px; height: 17px; }
.footer-bottom {
  max-width: var(--maxw); margin: 40px auto 0; padding: 24px 28px 0;
  border-top: 0.5px solid var(--border); display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap; gap: 8px;
}
.footer-bottom a { color: var(--text-muted); transition: color 0.25s var(--ease); }
.footer-bottom a:hover { color: var(--gold-text); }

/* ----- Contact form ----- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 12.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.field input, .field textarea {
  font-family: var(--sans); font-size: 15px; color: var(--text-strong);
  background: var(--bg); border: 0.5px solid var(--border-strong); border-radius: 9px;
  padding: 12px 14px; outline: none; transition: border-color 0.2s var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--cool-border); }
.field textarea { resize: vertical; min-height: 130px; }

.form-note { font-size: 12.5px; color: var(--text-muted); margin-top: 14px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface); color: var(--text-strong); border: 0.5px solid var(--gold-border);
  padding: 13px 22px; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 80; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----- Reveal-on-scroll motion ----- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ----- Pull quote ----- */
.pullquote {
  font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.4;
  color: var(--text-strong); border-left: 2px solid var(--gold); padding-left: 22px; margin: 8px 0;
}

/* ----- Chapter marker ----- */
.chapter-num { font-family: var(--serif); font-size: 15px; color: var(--gold); letter-spacing: 0.1em; margin: 0 0 8px; }

/* ----- Masonry photo grid ----- */
.masonry { columns: 3; column-gap: 16px; }
.masonry figure { margin: 0 0 16px; break-inside: avoid; }
.masonry .ph {
  border-radius: var(--radius-sm); border: 0.5px solid var(--border); overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; color: var(--text-muted);
  font-size: 12px;
}
.masonry figcaption { font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--text-muted); margin-top: 7px; }

/* ----- Repo / list rows ----- */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; border-bottom: 0.5px solid var(--border);
}
.row:last-child { border-bottom: 0; }

/* ----- Embed shell ----- */
.embed {
  border-radius: var(--radius-sm); border: 0.5px solid var(--border);
  box-shadow: var(--shadow-sm); overflow: hidden; background: var(--surface-2);
}
.embed-caption { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--text-muted); margin-top: 10px; }

/* =========================================================================
   HOME hero: animated map carried over from the approved mockup
   ========================================================================= */
.hero-wrap {
  position: relative; height: min(92vh, 760px); overflow: hidden; background: var(--bg);
}
#hero-map { position: absolute; inset: 0; }
.maplibregl-canvas:focus { outline: none; }

.hero-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(180deg, rgba(11,18,36,0.62) 0%, rgba(11,18,36,0.12) 20%, rgba(11,18,36,0.12) 55%, rgba(11,18,36,0.86) 100%),
    radial-gradient(120% 80% at 100% 0%, rgba(216,185,138,0.06) 0%, rgba(216,185,138,0) 50%);
}
[data-theme="light"] .hero-vignette {
  background:
    linear-gradient(180deg, rgba(250,250,250,0.55) 0%, rgba(250,250,250,0.10) 22%, rgba(250,250,250,0.10) 52%, rgba(250,250,250,0.92) 100%),
    radial-gradient(120% 80% at 100% 0%, rgba(154,123,63,0.06) 0%, rgba(154,123,63,0) 50%);
}

.hero-overlay {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-overlay .wrap { width: 100%; }
.hero-content {
  display: grid; grid-template-columns: 1fr 200px; gap: 40px; align-items: center;
}
.hero-text { max-width: 600px; }
.hero-text h1 { font-size: clamp(40px, 6vw, 68px); margin: 0 0 18px; color: var(--text-strong); text-shadow: 0 2px 28px rgba(11,18,36,0.55); }
.hero-text .eyebrow { text-shadow: 0 1px 16px rgba(11,18,36,0.8); }
.hero-text .lede { max-width: 480px; margin: 0 0 22px; text-shadow: 0 1px 16px rgba(11,18,36,0.6); color: var(--text); }
[data-theme="light"] .hero-text h1,
[data-theme="light"] .hero-text .lede { text-shadow: 0 1px 14px rgba(250,250,250,0.8); }
.hero-pills { pointer-events: auto; }

.hero-avatar {
  width: 200px; height: 200px; border-radius: 22px; overflow: hidden; pointer-events: auto;
  border: 0.5px solid var(--border-strong); box-shadow: var(--shadow);
  background: var(--surface-2); position: relative;
}
.hero-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.hero-caption {
  position: absolute; left: 0; right: 0; bottom: 86px; z-index: 2; text-align: center;
  font-size: 12.5px; letter-spacing: 0.16em; color: var(--gold-text);
  text-transform: uppercase; pointer-events: none;
  opacity: 0; transition: opacity 1s var(--ease);
}
.hero-caption.show { opacity: 0.9; }

.scroll-cue {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 3;
  color: var(--text-dim); pointer-events: none; animation: bounce 2s var(--ease) infinite;
}
.scroll-cue svg { width: 22px; height: 22px; }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(7px); } }

.hero-hint {
  position: absolute; right: 18px; top: 18px; z-index: 3; pointer-events: none;
  background: rgba(244,239,228,0.10); color: var(--text-strong); border: 0.5px solid rgba(244,239,228,0.22);
  padding: 6px 13px; border-radius: 999px; font-size: 11px; letter-spacing: 0.06em;
  backdrop-filter: blur(8px); transition: opacity 0.6s ease;
}
.hero-hint.hidden { opacity: 0; }

/* Click-to-interact gate: sits above the map (z1) but below the hero text/pills
   (z2), so the page scrolls over the map until the visitor clicks in. */
.map-gate { position: absolute; inset: 0; z-index: 1; cursor: pointer; background: transparent; }

/* ----- Page hero (inner pages) ----- */
.page-hero { padding: 88px 0 40px; }
.page-hero h1 { font-size: clamp(36px, 5vw, 56px); margin: 0 0 18px; }
.page-hero .lede { max-width: 600px; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  :root { --space-section: 84px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .masonry { columns: 2; }
}

@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  .nav-links { display: none; }
  .hamburger { display: grid; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .masonry { columns: 1; }
  .section-head h2 { font-size: 28px; }

  .hero-wrap { height: auto; min-height: 88vh; padding: 96px 0 56px; display: flex; align-items: center; }
  .hero-overlay { position: relative; }
  .hero-content { grid-template-columns: 1fr; gap: 22px; }
  .hero-avatar { order: -1; width: 96px; height: 96px; border-radius: 16px; }
  .hero-caption { position: static; bottom: auto; left: auto; right: auto; margin-top: 20px; padding: 0; text-align: left; font-size: 11px; letter-spacing: 0.14em; }
  .scroll-cue { display: none; }
  .footer-bottom { padding-left: 18px; padding-right: 18px; }
}

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