/* ===================================
   Jonathan Kurniawan — Personal Site
   EB Garamond + teal #008080
   Editorial minimalism, 660px column
   8px spacing grid
   =================================== */

/* ---- Design Tokens ---- */
:root {
  /* Color */
  --teal: #008080;
  --teal-hover: #006666;
  --teal-faint: rgba(0, 128, 128, 0.06);
  --text: #1a1a1a;
  --text-secondary: #363636;
  --text-muted: #6e6e6e;
  --bg: #faf9f7;
  --bg-white: #ffffff;
  --border: #e0ddd8;
  --border-light: #eceae6;

  /* Type Scale (base 21px) */
  --text-xs: 0.78rem;     /* ~16px */
  --text-sm: 0.88rem;     /* ~18px */
  --text-base: 1rem;      /* 21px */
  --text-md: 1.1rem;      /* ~23px */
  --text-lg: 1.7rem;      /* ~36px — thesis */
  --text-xl: 2rem;        /* ~42px — page titles */

  /* Spacing (8px grid) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 1rem;      /* 16px */
  --space-4: 1.5rem;    /* 24px */
  --space-5: 2rem;      /* 32px */
  --space-6: 2.5rem;    /* 40px */
  --space-7: 3rem;      /* 48px */
  --space-8: 4rem;      /* 64px */
  --space-9: 5rem;      /* 80px */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 21px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection styling */
::selection {
  background: var(--teal);
  color: var(--bg-white);
}

/* ---- Masthead Line (visual signature) ---- */
body::before {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: var(--teal);
}

/* ---- Focus States (accessibility) ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---- Navigation ---- */
nav {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-light);
}

nav .nav-name a {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

nav .nav-name a:hover {
  color: var(--teal);
}

nav .nav-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

nav .nav-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}

nav .nav-links a:hover {
  color: var(--teal);
}

nav .nav-links a.active {
  color: var(--teal);
  font-weight: 500;
}

/* ---- Page Layout ---- */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-7) var(--space-4) var(--space-9);
}

/* ---- Page Header (subpages) ---- */
.page-header {
  margin-bottom: var(--space-7);
}

.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.page-header .page-subtitle {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- Home Hero ---- */
.hero {
  padding: var(--space-8) 0 var(--space-5);
}

.hero .thesis {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: var(--space-5);
}

.hero .thesis em {
  color: var(--teal);
  font-style: italic;
  font-weight: 600;
}

.hero .intro {
  font-size: var(--text-md);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-2);
}

.hero .name-line {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin-top: var(--space-5);
}

.hero .name-line strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- Anchor Credential ---- */
.anchor-credential {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  line-height: 1.7;
}

.anchor-credential strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---- Home Section Links ---- */
.home-sections {
  margin-top: var(--space-5);
}

.home-section-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s ease;
}

.home-section-link:first-child {
  border-top: 1px solid var(--border-light);
}

.home-section-link:hover {
  color: var(--teal);
}

.home-section-link:hover .section-link-arrow {
  transform: translateX(4px);
  color: var(--teal);
}

.home-section-link .section-link-content {
  flex: 1;
}

.home-section-link .section-link-title {
  font-weight: 600;
  font-size: var(--text-base);
}

.home-section-link .section-link-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
  transition: color 0.2s ease;
}

.home-section-link:hover .section-link-desc {
  color: var(--teal);
}

.home-section-link .section-link-arrow {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-left: var(--space-3);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

/* ---- Sections (subpages) ---- */
section {
  margin-bottom: var(--space-7);
}

section h2 {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

/* ---- Prose ---- */
.prose p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- Beliefs / Arguments ---- */
.argument-list {
  list-style: none;
  counter-reset: argument;
}

.argument-list li {
  margin-bottom: var(--space-4);
  padding-left: var(--space-4);
  border-left: 2px solid var(--border-light);
  color: var(--text-secondary);
  line-height: 1.8;
  transition: border-color 0.3s ease;
}

.argument-list li:hover {
  border-left-color: var(--teal);
}

.argument-list li:last-child {
  margin-bottom: 0;
}

/* ---- Work Items ---- */
.work-item {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.work-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.work-item .work-client {
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-md);
}

.work-item .work-desc {
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.work-item .work-outcome {
  color: var(--teal);
  font-weight: 500;
  margin-top: var(--space-2);
}

/* ---- Roles / Career ---- */
.role {
  margin-bottom: var(--space-4);
}

.role:last-child {
  margin-bottom: 0;
}

.role-headline {
  font-weight: 600;
  color: var(--text);
}

.role-org {
  color: var(--teal);
  font-weight: 500;
}

.role-date {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.role-desc {
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ---- Career highlight callout ---- */
.career-highlight {
  border-left: 3px solid var(--teal);
  padding: var(--space-4);
  margin: var(--space-3) 0 var(--space-4);
  background: var(--teal-faint);
  border-radius: 0 4px 4px 0;
}

.career-highlight .role-headline {
  font-size: var(--text-md);
}

.career-highlight .highlight-metrics {
  color: var(--teal);
  font-weight: 600;
  margin-top: var(--space-2);
}

/* ---- Writing / Talks Lists ---- */
.entry-list {
  list-style: none;
}

.entry-list li {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.entry-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.entry-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.entry-list a:hover {
  color: var(--teal);
  border-color: var(--teal);
}

.entry-list .entry-meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.entry-list .entry-title {
  font-weight: 500;
  color: var(--text);
}

/* ---- Contact Links ---- */
.contact-links {
  list-style: none;
}

.contact-links li {
  margin-bottom: var(--space-2);
}

.contact-links a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-links a:hover {
  border-color: var(--teal);
}

/* ---- Footer ---- */
.footer {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  body {
    font-size: 18px;
  }

  nav {
    padding: var(--space-4) var(--space-3) var(--space-3);
    flex-direction: column;
    gap: var(--space-2);
  }

  nav .nav-links {
    gap: var(--space-3);
  }

  .page {
    padding: var(--space-5) var(--space-3) var(--space-8);
  }

  .hero {
    padding: var(--space-6) 0 var(--space-4);
  }

  .hero .thesis {
    font-size: 1.4rem;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }

  .page-header {
    margin-bottom: var(--space-5);
  }

  section {
    margin-bottom: var(--space-5);
  }

  .home-section-link .section-link-arrow {
    display: none;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---- Print ---- */
@media print {
  body { font-size: 12pt; background: white; }
  body::before { display: none; }
  nav { display: none; }
  .page { max-width: 100%; padding: 0; }
  a { color: var(--text); }
  section h2 { color: var(--text); }
  .anchor-credential { border-top: 1px solid #ccc; }
}
