/* =============================================================
   PERSONAL WEBSITE — SHARED STYLESHEET
   ---------------------------------------------------------------
   All visual tokens live in :root below.
   Change colours, sizes, and spacing here — nowhere else.
   Search for a variable name to find every place it is used.
   ============================================================= */

/* -------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------- */
:root {

  /* --- Colour palette ---
     Adjust these to retheme the entire site instantly.          */

  --ink:          #1c1c1a;   /* Primary text & borders           */
  --paper:        #f8f7f5;   /* Page background (warm off-white) */
  --mid:          #8a8a84;   /* Secondary / muted text           */
  --rule:         #e2dfd9;   /* Hairline dividers                */

  /* Sage green accent — swap this hex to change accent colour   */
  --sage:         #7a9e7e;   /* Main accent                      */
  --sage-light:   #edf2eb;   /* Accent tint (backgrounds, tags)  */
  --sage-dark:    #4f7352;   /* Deeper accent (hover states)     */

  /* --- Typography ---                                          */
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'Jost', sans-serif;

  /* Font sizes — scale the whole type system from here          */
  --text-xs:      0.62rem;   /* Labels, tags, captions           */
  --text-sm:      0.80rem;   /* Secondary body copy              */
  --text-base:    0.95rem;   /* Primary body copy                */
  --text-lg:      1.05rem;   /* Lead paragraphs                  */
  --text-xl:      1.30rem;   /* Card headings                    */
  --text-2xl:     2.00rem;   /* Section headings (desktop)       */
  --text-hero:    clamp(3.25rem, 10vw, 6.5rem); /* Hero name    */

  /* --- Spacing scale ---                                       */
  --sp-xs:        0.5rem;
  --sp-sm:        0.875rem;
  --sp-md:        1.5rem;
  --sp-lg:        2.5rem;
  --sp-xl:        4rem;
  --sp-2xl:       6rem;

  /* --- Layout ---                                              */
  --max-width:    1060px;    /* Max content width                */
  --side-pad:     clamp(1.25rem, 5vw, 3rem); /* Horizontal gutter*/
  --nav-h:        60px;      /* Nav bar height                   */
  --radius:       3px;       /* Subtle rounding on cards / tags  */

  /* --- Transitions ---                                         */
  --ease:         0.2s ease;
}

/* -------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-weight: 300;
  line-height: 1.75;
  font-size: var(--text-base);
  /* Sticky footer: pushes footer to bottom of viewport on short pages,
     preventing the fixed frog layer from showing below it */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* -------------------------------------------------------------
   3. NAVIGATION
   ------------------------------------------------------------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Wordmark / logo */
.logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

/* Desktop link list */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  list-style: none;
}

.nav-link {
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  position: relative;
  transition: color var(--ease);
}

/* Animated underline — turns sage on active/hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--sage);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ease);
}
.nav-link:hover,
.nav-link.active { color: var(--ink); }
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* Frog visibility is a developer setting in frogs.js — no nav button needed */

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--paper);
  z-index: 99;
  padding: var(--sp-lg) var(--side-pad);
  flex-direction: column;
  gap: var(--sp-md);
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { font-size: 1rem; }

/* -------------------------------------------------------------
   4. LAYOUT HELPERS
   ------------------------------------------------------------- */
main { padding-top: var(--nav-h); flex: 1; }

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

/* Narrow wrapper for text-heavy pages (CV, imprint) */
.wrapper-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* -------------------------------------------------------------
   5. SECTION ANATOMY
   Used on the landing page for About / Skills / Projects        
   ------------------------------------------------------------- */
.section {
  padding: 1.25rem 0 2.75rem;
  border-bottom: 1px solid var(--rule);
}
.section:last-child { border-bottom: none; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--sp-md);
}

.section-label {
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
}

.section-more {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color var(--ease), border-color var(--ease);
}
.section-more:hover { color: var(--sage-dark); border-color: var(--sage); }

/* Page header (used on inner pages) */
.page-header {
  padding: clamp(3rem, 9vw, var(--sp-2xl)) 0 var(--sp-md);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(var(--sp-md), 5vw, var(--sp-xl));
}

/* Compact variant — for utility pages (imprint etc.) where the large
   hero-style top padding would feel out of place.
   Usage: <header class="page-header page-header--compact"> */
.page-header--compact {
  padding-top: var(--sp-lg);   /* 2.5rem instead of up to 6rem */
  margin-bottom: var(--sp-lg);
}
.page-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.page-header p {
  margin-top: 0.65rem;
  color: var(--mid);
  font-size: var(--text-sm);
  max-width: 440px;
}

/* -------------------------------------------------------------
   6. BUTTONS
   ------------------------------------------------------------- */
.btn {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.65rem 1.6rem;
  border: 1px solid var(--ink);
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  display: inline-block;
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--paper); }

/* Sage-filled primary button */
.btn-primary {
  background: var(--sage);
  color: var(--paper);
  border-color: var(--sage);
}
.btn-primary:hover {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: var(--paper);
}

/* -------------------------------------------------------------
   7. HERO (landing page)
   ------------------------------------------------------------- */
.hero {
  padding: clamp(3.5rem, 10vw, var(--sp-2xl)) 0 clamp(2.5rem, 7vw, var(--sp-xl));
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-lg);
  align-items: end;
}

.hero-text .eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage);           /* sage accent on eyebrow */
  margin-bottom: var(--sp-sm);
}
.hero-text h1 {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-sm);
}
.hero-text .tagline {
  font-size: var(--text-lg);
  color: var(--mid);
  max-width: 480px;
  line-height: 1.75;
}
.hero-ctas {
  margin-top: var(--sp-md);
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

/* Profile photo */
.hero-photo {
  flex-shrink: 0;
  width: clamp(140px, 18vw, 220px);
  aspect-ratio: 3 / 4;
  background: var(--sage-light);
  border: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Placeholder shown when no real photo is set */
.hero-photo .photo-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--mid);
}
.hero-photo .photo-placeholder span:first-child {
  font-size: 2.5rem;
  opacity: 0.35;
}
.hero-photo .photo-placeholder span:last-child {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------
   8. SKILLS TAGS
   ------------------------------------------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }

.tag {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--rule);
  color: var(--mid);
  border-radius: var(--radius);
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.tag:hover {
  border-color: var(--sage);
  color: var(--sage-dark);
  background: var(--sage-light);
}

/* -------------------------------------------------------------
   9. PROJECT CARDS
   ------------------------------------------------------------- */

/* Grid — no background trick; cards carry their own border.
   Empty cells are invisible.                                    */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.project-card {
  border: 1px solid var(--rule);
  margin: -0.5px;           /* Collapse adjacent borders into hairlines */
  background: var(--paper);
  cursor: pointer;
  transition: background var(--ease);
  display: flex;
  flex-direction: column;
}
.project-card:hover { background: var(--sage-light); }

/* Thumbnail image area — replace with <img> when available */
.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--sage-light);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.03); }

/* Thumbnail placeholder */
.project-thumb .thumb-label {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  position: absolute;
}

.project-body { padding: var(--sp-md); flex: 1; display: flex; flex-direction: column; }

.project-category {
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);       /* sage accent on category */
  margin-bottom: var(--sp-xs);
}

.project-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--sp-xs);
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--mid);
  line-height: 1.7;
  flex: 1;
}

.project-foot {
  margin-top: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  letter-spacing: 0.07em;
  color: var(--mid);
}

.project-open-btn {
  display: inline-block;
  margin-top: var(--sp-sm);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 0;
  transition: color var(--ease);
}
.project-open-btn:hover { color: var(--ink); }

/* -------------------------------------------------------------
   10. PROJECT DETAIL MODAL
   ------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 26, 0.55);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: var(--nav-h) var(--side-pad) var(--side-pad);
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  max-width: 680px;
  width: 100%;
  margin-top: var(--sp-md);
  position: relative;
}

.modal-close {
  position: absolute;
  top: var(--sp-sm); right: var(--sp-sm);
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid);
  transition: border-color var(--ease), color var(--ease);
}
.modal-close:hover { border-color: var(--ink); color: var(--ink); }

.modal-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--sage-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.modal-thumb .thumb-label { font-size: var(--text-xs); letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage); }

.modal-body { padding: var(--sp-md) var(--sp-lg); }
.modal-category { font-size: var(--text-xs); letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage); margin-bottom: var(--sp-xs); }
.modal-title { font-family: var(--font-serif); font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: var(--sp-sm); }
.modal-desc { font-size: var(--text-base); color: var(--mid); line-height: 1.8; margin-bottom: var(--sp-md); }
.modal-detail { font-size: var(--text-base); line-height: 1.85; margin-bottom: var(--sp-md); }
.modal-meta { display: flex; flex-wrap: wrap; gap: var(--sp-xs); align-items: center; border-top: 1px solid var(--rule); padding-top: var(--sp-sm); margin-top: var(--sp-sm); font-size: var(--text-xs); color: var(--mid); }
.modal-meta span { letter-spacing: 0.07em; }
.modal-meta .sep { color: var(--rule); }

/* -------------------------------------------------------------
   11. CV PAGE
   ------------------------------------------------------------- */
.cv-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-md);
  flex-wrap: wrap;
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--sp-lg);
}
.cv-name { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; }
.cv-role { font-size: var(--text-sm); color: var(--mid); margin-top: 0.2rem; }

.cv-section { margin-bottom: var(--sp-lg); padding-bottom: var(--sp-lg); border-bottom: 1px solid var(--rule); }
.cv-section:last-child { border-bottom: none; }
.cv-section-label { font-size: var(--text-xs); letter-spacing: 0.2em; text-transform: uppercase; color: var(--sage); margin-bottom: var(--sp-md); }

.cv-entry { margin-bottom: var(--sp-md); }
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.15rem; }
.cv-entry-title { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; }
.cv-entry-date { font-size: var(--text-xs); letter-spacing: 0.08em; color: var(--mid); }
.cv-entry-sub { font-size: var(--text-sm); color: var(--mid); font-style: italic; margin-bottom: 0.4rem; }
.cv-entry-desc { font-size: var(--text-sm); line-height: 1.75; color: #555; }

/* -------------------------------------------------------------
   12. CONTACT PAGE
   ------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
  margin-top: var(--sp-lg);
}
.contact-label { font-size: var(--text-xs); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mid); margin-bottom: var(--sp-sm); }

.contact-email {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color var(--ease), color var(--ease);
  padding-bottom: 0.2rem;
  display: inline-block;
}
.contact-email:hover { border-color: var(--sage); color: var(--sage-dark); }

.social-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-sm); }
.social-list a {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: color var(--ease);
}
.social-list a:hover { color: var(--sage-dark); }
.social-list a::before {
  content: '';
  display: block;
  width: 20px; height: 1px;
  background: currentColor;
  transition: width var(--ease);
  flex-shrink: 0;
}
.social-list a:hover::before { width: 36px; }

/* -------------------------------------------------------------
   13. IMPRINT PAGE
   ------------------------------------------------------------- */
.imprint-body { padding-bottom: var(--sp-xl); }
.imprint-body h2 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; margin: var(--sp-md) 0 var(--sp-xs); }
.imprint-body h2:first-child { margin-top: 0; }
.imprint-body p { font-size: var(--text-base); color: var(--mid); line-height: 1.85; margin-bottom: var(--sp-xs); }
.imprint-body a { color: var(--sage-dark); }

/* -------------------------------------------------------------
   14. FOOTER
   ------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--rule);
  padding: var(--sp-md) 0;
  margin-top: var(--sp-xl);
  position: relative;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  letter-spacing: 0.07em;
  color: var(--mid);
}
.footer-inner a { color: var(--mid); text-decoration: none; transition: color var(--ease); }
.footer-inner a:hover { color: var(--sage-dark); }

/* -------------------------------------------------------------
   15. FROGS
   Decorative frogs are injected as a fixed background layer
   by frogs.js. Toggle SHOW_FROGS in frogs.js to show/hide.
   Opacity and colour are also controlled there.
   ------------------------------------------------------------- */

/* Ensure page content always sits above the frog layer (z:0) */
nav  { z-index: 100; }
main { position: relative; z-index: 1; }
footer { position: relative; z-index: 1; }

/* -------------------------------------------------------------
   16. RESPONSIVE
   ------------------------------------------------------------- */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero {
    grid-template-columns: 1fr;
  }
  .hero-photo {
    width: clamp(100px, 40vw, 160px);
    aspect-ratio: 3 / 4;
    order: -1;              /* Photo above name on mobile */
  }

  .contact-grid { grid-template-columns: 1fr; gap: var(--sp-lg); }

  .modal-body { padding: var(--sp-md); }
}

@media (max-width: 480px) {
  .project-grid { grid-template-columns: 1fr; }
}