/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* Colors — Light */
  --color-bg:           #fafaf8;
  --color-text:         #1c1a18;
  --color-text-muted:   #5c5956;
  --color-accent:       #4A7C96;
  --color-accent-hover: #3a6a82;
  --color-border:       #dedad4;
  --color-photo-bg:     #e4dfd8;
  --color-photo-text:   #7a746c;

  /* Typography */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', ui-monospace, monospace;

  /* Scale */
  --text-xs:   0.875rem;
  --text-sm:   1rem;
  --text-base: 1.0625rem;   /* 17px */
  --text-lg:   1.1875rem;   /* 19px */
  --text-xl:   1.375rem;    /* 22px */
  --text-2xl:  2rem;        /* 32px */

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Layout */
  --max-width: 1060px;
  --page-pad:  2rem;
}

/* Dark mode overrides */
[data-theme="dark"] {
  --color-bg:           #171615;
  --color-text:         #e4e0db;
  --color-text-muted:   #8a8580;
  --color-accent:       #6ba3bc;
  --color-accent-hover: #89b8d0;
  --color-border:       #2e2c29;
  --color-photo-bg:     #2a2825;
  --color-photo-text:   #6a6560;
}

/* Dark/light icon visibility */
[data-theme="light"] .icon-light { display: none; }
[data-theme="dark"]  .icon-dark  { display: none; }


/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.72;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 600;
}

h1 {
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-base);
  font-weight: 600;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--sp-1) var(--sp-2);
  letter-spacing: 0.04em;
  border-radius: 3px;
  transition: color 0.1s, background-color 0.1s;
}

button:hover {
  color: var(--color-text);
  background-color: var(--color-border);
}

button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}ß


/* ============================================================
   Navigation
   ============================================================ */
.nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 48px;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding: var(--sp-2) 0;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.1s;
}

.nav-links a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
}

#theme-toggle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-muted);
  background: transparent;
  letter-spacing: 0.05em;
  line-height: 1;
}

#theme-toggle {
  font-size: 0.9rem;
  padding: var(--sp-1) var(--sp-2);
}

#theme-toggle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: transparent;
}

/* Burger button — hidden on desktop */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: var(--sp-2);
  border: none;
  background: none;
  cursor: pointer;
  order: 1;
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-text-muted);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-burger:hover span {
  background-color: var(--color-accent);
}

nav.nav-open .nav-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

nav.nav-open .nav-burger span:nth-child(2) {
  opacity: 0;
}

nav.nav-open .nav-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ============================================================
   Header / Intro
   ============================================================ */
header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-12) var(--page-pad) var(--sp-10);
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
}

.intro-text {
  flex: 1;
}

.intro-text h1 {
  margin-bottom: var(--sp-3);
}

.tagline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-3);
  max-width: none;
}

.intro-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-5);
}

.intro-links {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
}

.intro-links .sep {
  color: var(--color-border);
  user-select: none;
}

.intro-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background-color: var(--color-photo-bg);
  color: var(--color-photo-text);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
  user-select: none;
}

.photo {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-position: top;
  object-fit: cover;
  display: block;
}


/* ============================================================
   Main Content — shared section styles
   ============================================================ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad) var(--sp-16) var(--page-pad);
}

section {
  padding-top: var(--sp-12);
  padding-bottom: var(--sp-6);
  border-top: 1px solid var(--color-border);
}

section h2 {
  margin-bottom: var(--sp-1);
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-6);
}

section p {
  margin-top: var(--sp-4);
}

section p:first-of-type {
  margin-top: 0;
}


/* ============================================================
   Two-column section wrapper
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--sp-12);
  border-top: 1px solid var(--color-border);
}

.two-col > section {
  border-top: none;
  padding-top: var(--sp-12);
}


/* ============================================================
   Garden Section
   ============================================================ */
.garden-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  text-decoration: none;
  margin-top: var(--sp-5);
  letter-spacing: 0.02em;
}

.garden-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}


/* ============================================================
   Experience
   ============================================================ */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

.experience-header {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: var(--sp-2);
}

.experience-company {
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

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

.experience-role::before {
  content: '·';
  margin-right: var(--sp-2);
}

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

.experience-period::before {
  content: '·';
  margin-right: var(--sp-2);
}

.experience-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 0;
}


/* ============================================================
   Projects
   ============================================================ */
.projects-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8) var(--sp-12);
}

.project-item h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--sp-1);
}

.project-item p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 0;
}


/* ============================================================
   Education
   ============================================================ */
.education-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.education-main {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: var(--sp-1);
}

.education-school {
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

.education-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.education-status::before {
  content: '·';
  margin-right: var(--sp-2);
}

.education-detail {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.education-highlights {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--sp-2);
}

.education-highlights ul {
  list-style: none;
  padding-left: var(--sp-5);
  margin-top: var(--sp-1);
}

.education-highlights li {
  margin-bottom: var(--sp-2);
}

.education-highlights li::before {
  content: '– ';
  margin-right: var(--sp-1);
}


/* ============================================================
   Contact
   ============================================================ */
.contact-list {
  margin-top: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}


/* ============================================================
   Footer
   ============================================================ */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--sp-6) var(--page-pad) var(--sp-10);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}


/* ============================================================
   Responsive
   ============================================================ */

/* Mobile nav burger */
@media (max-width: 640px) {
  nav {
    flex-wrap: wrap;
    align-items: center;
  }

  .nav-burger {
    display: flex;
    order: 1;
  }

  .nav-controls {
    order: 2;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-top: 1px solid var(--color-border);
  }

  nav.nav-open .nav-links {
    display: flex;
  }
}


/* Collapse two-column sections to single column */
@media (max-width: 780px) {
  .two-col {
    grid-template-columns: 1fr;
    border-top: none;
  }

  .two-col > section {
    border-top: 1px solid var(--color-border);
  }

  .projects-list {
    grid-template-columns: 1fr;
  }

  .photo-placeholder,
  .photo {
    width: 190px;
    height: 190px;
  }
  .intro {
    align-items: flex-start;
  }
}

/* Small screens */
@media (max-width: 540px) {
  :root {
    --page-pad: 1.125rem;
    --text-2xl: 1.625rem;
  }

  .intro {
    flex-direction: column-reverse;
    gap: var(--sp-4);
  }

  .photo-placeholder,
  .photo {
    width: 120px;
    height: 120px;
  }

  header {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-8);
  }

  section {
    padding-top: var(--sp-10);
  }

  .two-col > section {
    padding-top: var(--sp-10);
  }
}


/* ============================================================
   Print
   ============================================================ */
@media print {
  .nav-wrapper,
  #theme-toggle,
  .skip-link,
  footer a[href="#top"] {
    display: none !important;
  }

  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  h1 { font-size: 20pt; }
  h2 { font-size: 14pt; }

  section {
    page-break-inside: avoid;
    border-top: 0.5pt solid #ccc;
  }

  .garden-link::after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    color: #666;
  }
}
