@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400&family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500&display=swap');

/* ============================================
   Reset
   ============================================ */

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

/* ============================================
   Tokens
   ============================================ */

:root {
  --bg-deep: #f6f4f0;
  --bg-surface: #edeae4;
  --bg-card: rgba(255, 255, 255, 0.55);
  --bg-card-hover: rgba(255, 255, 255, 0.8);
  --text-primary: #2b3029;
  --text-secondary: #4d524b;
  --accent: #3d7a5f;
  --accent-dim: rgba(61, 122, 95, 0.08);
  --accent-bright: #4a9470;
  --accent-bright-dim: rgba(74, 148, 112, 0.1);
  --border: #d4d1cb;
  --border-hover: #a8a49e;
  --border-active: rgba(61, 122, 95, 0.4);
  --shadow-card:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.04),
    0 16px 24px -8px rgba(0, 0, 0, 0.06);
  --shadow-card-hover:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 8px 12px -4px rgba(0, 0, 0, 0.06),
    0 20px 32px -8px rgba(0, 0, 0, 0.1);
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration: 0.25s;
}

/* ============================================
   Base
   ============================================ */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.57;
  min-height: 100vh;
  position: relative;
}

/* Paper texture base */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: url('paper-texture.jpg') repeat;
  background-size: 512px 512px;
  opacity: 0.35;
  mix-blend-mode: multiply;
}

/* Dot grid overlay — denser, off-center fade */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--border) 0.8px, transparent 0.8px);
  background-size: 16px 16px;
  mask-image: radial-gradient(ellipse at 35% 40%, black 20%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 35% 40%, black 20%, transparent 65%);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

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

a:hover {
  color: var(--text-primary);
}

/* ============================================
   Header / Nav
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(246, 244, 240, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .logo {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-header nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--duration) var(--ease);
}

.site-header nav a:hover {
  color: var(--text-primary);
}

/* ============================================
   Buttons — hex-style with corner accents
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 10px 20px;
  border: 1px solid var(--border-hover);
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  letter-spacing: 0.04em;
  position: relative;
}

/* Corner accents */
.btn::before,
.btn::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--border-hover);
  border-style: solid;
  transition: border-color var(--duration) var(--ease);
}

.btn::before {
  top: -4px;
  left: -4px;
  border-width: 1px 0 0 1px;
}

.btn::after {
  top: -4px;
  right: -4px;
  border-width: 1px 1px 0 0;
}

.btn-corners {
  position: relative;
}

.btn-corners .corner-bl,
.btn-corners .corner-br {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--border-hover);
  border-style: solid;
  transition: border-color var(--duration) var(--ease);
}

.btn-corners .corner-bl {
  bottom: -4px;
  left: -4px;
  border-width: 0 0 1px 1px;
}

.btn-corners .corner-br {
  bottom: -4px;
  right: -4px;
  border-width: 0 1px 1px 0;
}

.btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn:hover::before,
.btn:hover::after {
  border-color: var(--text-primary);
}

.btn-corners:hover .corner-bl,
.btn-corners:hover .corner-br {
  border-color: var(--text-primary);
}

.btn-primary {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-primary::before,
.btn-primary::after {
  border-color: var(--text-primary);
}

.btn-primary .corner-bl,
.btn-primary .corner-br {
  border-color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--text-primary);
  color: var(--bg-deep);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: 130px 0 48px;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 4.5rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero .tagline {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero .tagline .focus {
  color: var(--accent);
  font-weight: 500;
}

.hero .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-bright);
  margin-bottom: 24px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--accent-bright-dim);
  border: 1px solid rgba(74, 148, 112, 0.2);
}

.hero .status .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Timeline
   ============================================ */

.timeline {
  position: relative;
  padding: 16px 0 80px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 80px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--border) 10%,
    var(--border) 90%,
    transparent
  );
}

.timeline-entry {
  position: relative;
  padding-left: 52px;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s var(--ease) forwards;
}

.timeline-entry:nth-child(1) { animation-delay: 0.1s; }
.timeline-entry:nth-child(2) { animation-delay: 0.2s; }
.timeline-entry:nth-child(3) { animation-delay: 0.3s; }
.timeline-entry:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-dot {
  position: absolute;
  left: 10px;
  top: 24px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-deep);
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  z-index: 1;
}

.timeline-entry:hover .timeline-dot {
  transform: scale(1.15);
}

.timeline-entry.active .timeline-dot {
  background: var(--accent);
  transform: scale(1.15);
}

.timeline-entry.now .timeline-dot {
  border-color: var(--accent-bright);
}

.timeline-entry.now.active .timeline-dot {
  background: var(--accent-bright);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-card);
}

.timeline-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-card h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.timeline-card .date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.timeline-card .company {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 400;
}

.timeline-entry.now .timeline-card h3 {
  color: var(--accent);
}

.timeline-card .summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.timeline-card .detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
}

.timeline-card .detail-wrap {
  overflow: hidden;
}

.timeline-entry.active .timeline-card .detail {
  grid-template-rows: 1fr;
  opacity: 1;
}

.timeline-card .detail-inner {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.timeline-card .detail-inner p {
  margin-bottom: 10px;
}

.timeline-card .detail-inner p:last-child {
  margin-bottom: 0;
}

.timeline-card .detail-inner ul {
  list-style: none;
  padding: 0;
  margin-top: 8px;
}

.timeline-card .detail-inner ul li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 8px;
}

.timeline-card .detail-inner ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Expand hint for expandable cards */
.timeline-card .expand-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--border-hover);
  letter-spacing: 0.04em;
  margin-top: 10px;
  transition: color var(--duration) var(--ease);
}

.timeline-card:hover .expand-hint {
  color: var(--text-secondary);
}

.timeline-entry.active .expand-hint {
  display: none;
}

.timeline-card .read-more {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  transition: color var(--duration) var(--ease);
}

.timeline-card .read-more:hover {
  color: var(--text-primary);
}

.timeline-card .progression {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.timeline-card .progression span {
  color: var(--accent);
}

.timeline-card .sub-project {
  margin-bottom: 14px;
}

.timeline-card .sub-project:last-child {
  margin-bottom: 0;
}

.timeline-card .sub-project strong {
  color: var(--text-primary);
  font-weight: 500;
}

.timeline-card .sub-project em {
  color: var(--text-secondary);
  font-style: normal;
  font-size: 0.82rem;
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 60px 0 40px;
  border-top: 1px solid var(--border);
}

.section h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 20px;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.section p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  max-width: 600px;
}

.section .degree {
  color: var(--text-primary);
  font-weight: 400;
}

.section .editorial {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--text-secondary);
}

/* Resume download */
.resume-section h2 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--text-secondary);
}

/* ============================================
   Footer
   ============================================ */

footer {
  padding: 60px 0 80px;
  border-top: 1px solid var(--border);
}

footer .links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

footer a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--duration) var(--ease);
}

footer a:hover {
  color: var(--accent);
}

/* ============================================
   Sub-page layout
   ============================================ */

.sub-page {
  padding-top: 100px;
}

.sub-page .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 0.04em;
}

.sub-page .back:hover {
  color: var(--accent);
}

.sub-page h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.sub-page .sub-role {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.sub-page .sub-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: 32px;
}

.sub-page .content {
  max-width: 600px;
}

.sub-page .content h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.015em;
}

.sub-page .content p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.7;
}

.sub-page .content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 14px;
}

.sub-page .content ul li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.sub-page .content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

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

@media (max-width: 600px) {
  .hero {
    padding: 110px 0 40px;
  }

  .site-header nav a:not(.btn) {
    display: none;
  }

  .timeline::before {
    left: 12px;
  }

  .timeline-dot {
    left: 6px;
    top: 22px;
    width: 11px;
    height: 11px;
  }

  .timeline-entry {
    padding-left: 40px;
  }

  .timeline-card {
    padding: 16px 18px;
  }

  .timeline-card-header {
    flex-direction: column;
    gap: 2px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}
