/* Google Fonts (Fraunces for headings, Inter for body) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root{
  /* Minimal beach palette */
  --bg: #FBF6EC;                 /* warm sand */
  --panel: #FFFCF6;              /* sun-bleached sand */
  --text: #0B1B2A;               /* deep navy */
  --muted: #556270;              /* slate-blue */
  --border: rgba(11,27,42,.12);

  --accent: #1E6A7A;             /* ocean */
  --accent2: #66C6B6;            /* seafoam */
  --accent-soft: rgba(102,198,182,.16);

  /* Softer, more minimal depth */
  --shadow: 0 14px 35px rgba(11,27,42,.06);
  --radius: 18px;

  /* Alias used by header brand rules */
  --text-primary: var(--text);

  /* Wave speed (light mode) */
  --wave-speed: 6.2s;
}

*{ box-sizing: border-box; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  /* Make the body itself transparent so the aurora canvas can show through */
  background: transparent;
  color: var(--text);
  min-height: 100vh;
}

/* Background overlay layer (keeps your current aesthetic while letting aurora show) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 18% 10%, rgba(102,198,182,.14), transparent 60%),
    radial-gradient(920px 560px at 85% 18%, rgba(30,106,122,.10), transparent 58%),
    radial-gradient(760px 520px at 50% 95%, rgba(240,214,165,.22), transparent 60%),
    /* translucent base wash so content stays readable */
    rgba(251,246,236,.70);
}

:root.dark body::before{
  background:
    radial-gradient(900px 520px at 18% 10%, rgba(121,226,210,.10), transparent 60%),
    radial-gradient(920px 560px at 85% 18%, rgba(138,180,255,.10), transparent 58%),
    radial-gradient(760px 520px at 50% 95%, rgba(0,0,0,.20), transparent 60%),
    /* translucent night wash */
    rgb(6, 17, 30);
}

.container{
  width: min(1050px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header{
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(251,247,239,.72);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
:root.dark .site-header{
  background: rgba(6, 17, 30, .62);
}

.nav{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 18px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-links{
  display:flex;
  align-items:center;
  gap: 14px;
  flex-wrap: wrap;
}

.nav-links a{
  text-decoration:none;
  color: rgba(11,27,42,.62);
  font-weight: 500;
  margin-left: 0;
}
.nav-links a.active{ color: var(--text); font-weight: 600; }
:root.dark .nav-links a{ color: rgba(248,250,255,.78); }
:root.dark .nav-links a.active{ color: var(--text); }

.hero{
  padding: 64px 0 26px;
}

.pill{
  display:inline-block;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
:root.dark .pill{
  background: rgba(255,255,255,.14);
  color: var(--muted);
  border-color: rgba(248,250,255,.20);
}

/* Blog metadata pills (date/category) */
.meta-row{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.meta-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

:root.dark .meta-pill{
  background: rgba(255,255,255,.14);
  color: var(--muted);
  border-color: rgba(248,250,255,.20);
}

h1{
  margin: 18px 0 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.accent{
  color: var(--accent);
}

.lead{
  max-width: 58ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.subhead{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}

.cta-row{
  display:flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration:none;
  font-weight: 600;
}

.btn.primary{
  background: var(--text);
  color: #fff;
  border-color: rgba(11,27,42,.12);
}

.btn.ghost{
  background: rgba(255,255,255,.55);
  color: var(--text);
}

:root.dark .btn.primary{ background: #F8FAFF; color: #06111E; }
:root.dark .btn.ghost{ background: rgba(255,255,255,.10); color: var(--text); }

.panel{
  margin: 34px 0 14px;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-title{
  display:flex;
  align-items:center;
  gap: 12px;
}
.panel-title h2{
  margin:0;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.icon{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: var(--accent-soft);
}

.muted{ color: var(--muted); }
.small{ font-size: 13px; }

.grid-2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
  margin-top: 18px;
}
@media (max-width: 820px){
  .grid-2{ grid-template-columns: 1fr; }
}

.card{
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
}

.card-top{
  display:flex;
  gap: 12px;
  align-items:flex-start;
}
.mini-icon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(31,94,122,.10);
}

.card-title{
  font-weight: 700;
  margin-bottom: 4px;
}

/* Dark mode: WAIA cards on home page (Technical Research / Safety Governance) */
:root.dark .card{
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

:root.dark .card:hover{
  background: rgba(255,255,255,.09);
}

:root.dark .card-title{
  color: var(--text);
}

:root.dark .muted{
  color: var(--muted);
}

/* Darker icon bubble behind emojis in WAIA cards */
:root.dark .mini-icon{
  background: rgba(255,255,255,.22);
}

/* Wave divider (theme-aware + scroll-linked horizontal motion) */
.wave-divider{
  width: 100%;
  margin: 34px 0 10px;
  opacity: .85;
  overflow: hidden;
  animation: waveBob 2.6s ease-in-out infinite;
  will-change: transform;
}

.wave-divider svg{
  width: calc(100% + 140px);
  height: 44px;
  display: block;
  /* JS controls translateX for scroll-linked motion */
  transform: translateX(0);
  will-change: transform;
}

@keyframes waveBob{
  0%{ transform: translateY(0); }
  50%{ transform: translateY(4px); }
  100%{ transform: translateY(0); }
}

/* Light theme wave color */
.wave-divider path{
  fill: rgba(31,94,122,.14);
}

/* Dark theme wave color */
:root.dark .wave-divider path{
  fill: rgba(121,226,210,.14);
}

.link-row{
  display:inline-block;
  margin-top: 18px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.page-head{
  padding: 44px 0 20px;
}
.page-head.hero{
  padding: 44px 0 20px;
}
.page-head h1{
  font-size: 44px;
  margin: 0 0 6px;
}

.grid-3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  padding-bottom: 30px;
}
@media (max-width: 980px){
  .grid-3{ grid-template-columns: 1fr; }
}

.project-card{
  text-decoration:none;
  color: inherit;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  box-shadow: 0 10px 30px rgba(11,27,42,.06);
  transition: transform .12s ease, background .12s ease;
}
.project-card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.68);
}

/* Dark mode overrides for project cards and muted text */
:root.dark .project-card{
  background: rgba(255,255,255,.06);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}

:root.dark .project-card:hover{
  background: rgba(255,255,255,.09);
}

:root.dark .project-card .muted{ color: var(--muted); }

.project-title{
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 10px;
  display:flex;
  justify-content: space-between;
  align-items:center;
}
.arrow{ color: var(--muted); }

/* Dark mode arrow color override */
:root.dark .arrow{ color: var(--muted); }

.tag-row{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tag{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  color: var(--muted);
}

/* Dark mode overrides for tags (match the home pill vibe) */
:root.dark .tag{
  background: rgba(255,255,255,.16);
  color: var(--muted);
  border: 1px solid rgba(248,250,255,.22);
  font-weight: 500;
}

:root.dark .project-card:hover .tag{
  background: rgba(255,255,255,.22);
}

.posts{
  padding-bottom: 30px;
}
.post-row{
  display:block;
  padding: 18px 0;
  border-bottom: 1px solid rgba(11,27,42,.10);
  text-decoration:none;
  color: inherit;
}
.post-title{
  font-weight: 800;
  margin: 6px 0 6px;
}

.back{
  display:inline-block;
  margin-top: 26px;
  color: var(--muted);
  text-decoration:none;
  font-weight: 600;
}

.post{
  padding: 12px 0 40px;
}
.post h1{
  font-size: 48px;
  margin: 10px 0 14px;
  font-family: 'Fraunces', Georgia, serif;
}
.post-body p{
  max-width: 70ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 14px;
}

.footer{
  padding: 22px 0 40px;
  border-top: 1px solid rgba(11,27,42,.10);
  margin-top: 30px;
}

/* ---------- Dark mode variables ---------- */
:root.dark{
  --bg: #06111E;
  --panel: rgba(10, 22, 34, .80);
  --text: #F8FAFF;
  --muted: #D7E0F0;
  --border: rgba(248, 250, 255, .20);

  --accent: #8AB4FF;
  --accent2: #79E2D2;
  --accent-soft: rgba(138, 180, 255, .18);

  --shadow: 0 18px 55px rgba(0,0,0,.45);

  /* Calmer night sea */
  --wave-speed: 7.2s;

  --text-primary: var(--text);
}

/* ---------- Stars (night mode only) ---------- */
.stars{
  position: fixed;
  inset: 0;
  pointer-events:none;
  z-index:-1;
  display:none;
}
:root.dark .stars{ display:block; }

.star{
  position:absolute;
  width:2px;
  height:2px;
  background:white;
  border-radius:50%;
  opacity:.4;
  animation:twinkle 3s infinite ease-in-out;
}
@keyframes twinkle{
  50%{opacity:1;}
}

/* ---------- Toggle button ---------- */
.icon-btn{
  margin-left:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.55);
  color: var(--text);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-size:16px;
  line-height:1;
}
:root.dark .icon-btn{
  background: rgba(255,255,255,.10);
}
.icon-btn:hover{ transform: translateY(-1px); }

/* ---------- Wake animations (longer + more dramatic) ---------- */
.wake{
  position:absolute;
  pointer-events:none;
  z-index: 99999;
  font-size:34px;
  opacity:0;
  animation:wakeRide 1800ms cubic-bezier(.2,.9,.2,1) forwards;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,.25));
}
.wake.surf::before{content:"🏄‍♀️";}
.wake.dolphin::before{content:"🐬";}
.wake::after{
  content: "  🌊🌊🌊";
  font-size:22px;
  opacity:.85;
  display:inline-block;
  transform: translateY(10px);
}
.splash{
  position:absolute;
  left:18px;
  top:40px;
  width:7px;
  height:7px;
  background: rgba(121,226,210,.75);
  border-radius:50%;
  box-shadow:
    14px -10px 0 rgba(121,226,210,.40),
    28px 6px 0 rgba(121,226,210,.28),
    40px -8px 0 rgba(121,226,210,.22),
    54px 4px 0 rgba(121,226,210,.18);
  opacity:0;
  animation: splash 1800ms ease-out forwards;
}
@keyframes wakeRide{
  0%{transform:translate(0,16px) rotate(-10deg) scale(.92); opacity:0;}
  12%{opacity:1;}
  55%{transform:translate(260px,-14px) rotate(10deg) scale(1.05); opacity:.98;}
  100%{transform:translate(430px,-28px) rotate(16deg) scale(1.02); opacity:0;}
}
@keyframes splash{
  0%{opacity:0; transform:translate(0,0) scale(.8);}
  18%{opacity:.95;}
  100%{opacity:0; transform:translate(50px,-18px) scale(1.15);}
}

@media (max-width: 520px){
  .hero{ padding: 44px 0 18px; }
  .page-head.hero{ padding: 32px 0 18px;  }
  .cta-row{ gap: 10px; }
  .btn{ width: 100%; justify-content: center; }
  .panel{ padding: 18px; }
}

/* =========================
   Header brand styling
   ========================= */

.brand{
  font-weight: 650;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:visited,
.brand:hover,
.brand:active{
  color: var(--text);
  text-decoration: none;
}

/* Header nav links (theme-aware) */
.nav a,
.nav a:visited,
.nav-links a{
  color: rgba(11,27,42,.62);
  text-decoration: none;
}

.nav a:hover,
.nav-links a:hover{
  color: rgba(11,27,42,.86);
}

:root.dark .nav a,
:root.dark .nav a:visited,
:root.dark .nav-links a{
  color: rgba(248,250,255,.82);
}

:root.dark .nav a:hover,
:root.dark .nav-links a:hover{
  color: rgba(248,250,255,.96);
}

:root.dark .nav-links a.active{
  color: var(--text);
}

/* Avatar bubble*/
.avatar-bubble{
  width: 260px;
  height: 260px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

:root.dark .avatar-bubble{
  background: rgba(255,255,255,.10);
  border-color: rgba(248,250,255,.24);
}

.avatar-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar{
  width: 260px;
  height: 260px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display:block;
}

/* Give the Quick Timeline card a little breathing room from the cards above */
.card--spaced {
  margin-top: 18px;
}

/* Slightly smaller avatar on small screens */
@media (max-width: 520px){
  .avatar{
    width: 200px;
    height: 200px;
  }
}

:root.dark .avatar{
  border-color: rgba(248,250,255,.24);
}

.logo-bubble{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--border);
}
:root.dark .logo-bubble{
  background: rgba(255,255,255,.10);
  border-color: rgba(248,250,255,.22);
}

.logo-bubble img{
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.panel-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-head-right{
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 42px;
}

@media (max-width: 820px){
  .panel-head{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-head-right,
  .about-hero{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-head-right{
    order: -1;
    align-self: center;
  }

  .avatar-bubble{
    width: 200px;
    height: 200px;
  }
}

/* WAIA section spacing fix */
.panel-header{
  margin-top: 28px;
  margin-bottom: 10px;
}

/* Spacing */
.section{
  margin-top: 22px;
}
.section + .section{
  margin-top: 28px;
}

.panel-head h1,
.panel-head h2{
  margin-top: 0;
}

/* AURORA BACKGROUND LAYER */
#aurora-bg{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;

  /* force it behind everything */
  z-index: -10;
  pointer-events: none;

  /* reduce the “grey film” */
  opacity: 0.35;

  /* makes aurora feel like light, not fog */
  mix-blend-mode: screen;
}