@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #fafafa;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --border: #d2d2d7;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 18px;
  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-alt: #222224;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --accent: #2997ff;
  --accent-hover: #40a9ff;
  --border: #3a3a3c;
  --card-bg: #242426;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.45);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(250, 250, 250, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.4s ease;
}

[data-theme="dark"] nav {
  background: rgba(26, 26, 26, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

[data-theme="dark"] .nav-links.open {
  background: rgba(26, 26, 26, 0.95);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .hamburger span {
  background: var(--text);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 980px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.06);
}

[data-theme="dark"] .timeline-item::before {
  border-color: var(--bg);
}

nav .nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

nav .nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav .nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav .nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}

nav .nav-links a:hover,
nav .nav-links a.active {
  color: var(--text);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* ── LAYOUT ── */
.page-content {
  min-height: 100vh;
  padding-top: 52px;
}

.section-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

/* ── SECTION HEADERS ── */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-desc {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 3rem;
}

/* ── HERO ── */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 52px);
  text-align: center;
}

.hero-greeting {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s ease forwards;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s ease forwards;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent), #00c7be);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s ease forwards;
  min-height: 2.1em;
}

.typewriter-cursor {
  font-weight: 300;
  color: var(--accent);
  animation: blink 0.8s infinite;
  margin-left: 1px;
}

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

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s ease forwards;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border-radius: 980px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-display);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(0, 113, 227, 0.06);
  border-color: var(--accent);
}

/* ── PROJECT CARDS ── */
.project-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 2.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.project-header {
  padding: 2.5rem 2.5rem 0;
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.project-icon.ml { background: linear-gradient(135deg, #ff6b6b22, #ee5a2422); }
.project-icon.mc { background: linear-gradient(135deg, #51cf6622, #2d9c4622); }

.project-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.project-card .project-desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.tech-tag {
  padding: 0.3rem 0.75rem;
  background: var(--bg-alt);
  border-radius: 980px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.project-details {
  padding: 0 2.5rem 2.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-item {
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-radius: 12px;
}

.detail-item .detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.detail-item .detail-value {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ── DEEP DIVE EXPAND ── */
.expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem;
  margin-top: 1.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
  transition: all var(--transition);
}

.expand-btn:hover {
  background: rgba(0, 113, 227, 0.06);
  border-color: var(--accent);
}

.expand-btn .expand-arrow {
  transition: transform 0.3s ease;
  font-size: 0.75rem;
}

.expand-btn[aria-expanded="true"] .expand-arrow {
  transform: rotate(180deg);
}

.expand-btn[aria-expanded="true"] .expand-label::after {
  content: '';
}

.deep-dive {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.deep-dive.open {
  max-height: 5000px;
  transition: max-height 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.deep-dive-inner {
  padding-top: 1.75rem;
}

.dive-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.dive-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.dive-heading {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.dive-script {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.85rem;
  opacity: 0.85;
}

.dive-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.dive-text:last-child {
  margin-bottom: 0;
}

.dive-text code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--text);
}

.dive-list {
  list-style: none;
  margin: 0.5rem 0 0;
}

.dive-list li {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.65rem;
}

.dive-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.dive-list li strong {
  color: var(--text);
  font-weight: 600;
}

.dive-subsection {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.dive-subheading {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ── TIMELINE ── */
.timeline { position: relative; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  padding-bottom: 3rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-item.current::before {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.timeline-role {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.15rem;
}

.timeline-company {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.timeline-location {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
  font-family: var(--font-body);
  margin-bottom: 0.75rem;
}

.timeline-bullets { list-style: none; }

.timeline-bullets li {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.35rem;
}

.timeline-bullets li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--border);
}

/* ── EDUCATION ── */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 3rem;
}

.edu-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: box-shadow var(--transition);
}

.edu-card:hover { box-shadow: var(--card-shadow-hover); }

.edu-icon { font-size: 1.5rem; margin-bottom: 1rem; }

.edu-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.edu-card .edu-school {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
}

.edu-card .edu-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ── CONTACT ── */
.contact-page .section-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 52px);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.contact-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.contact-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.contact-card .contact-icon { font-size: 1.75rem; margin-bottom: 1rem; }

.contact-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.contact-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* ── QUICK GLANCE ── */
.glance-section {
  padding-top: 0;
}

.glance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.glance-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.glance-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.glance-icon {
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
}

.glance-stat {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.glance-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  line-height: 1.4;
}

/* ── GUESTBOOK ── */
.guestbook-form-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.gb-form-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.gb-form-body {
  padding: 2rem;
}

.gb-field {
  margin-bottom: 1.25rem;
  position: relative;
}

.gb-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.gb-input,
.gb-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}

.gb-input:focus,
.gb-textarea:focus {
  border-color: var(--accent);
}

.gb-char-count {
  text-align: right;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin-top: 0.3rem;
}

.gb-submit {
  margin-top: 0.25rem;
}

.gb-status {
  font-size: 0.82rem;
  margin-top: 0.75rem;
  font-family: var(--font-body);
  min-height: 1.2em;
}

.gb-status-success { color: #34c759; }
.gb-status-error { color: #ff3b30; }

.gb-disclaimer {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-family: var(--font-body);
  line-height: 1.6;
}

.gb-messages-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.gb-messages-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.gb-messages-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.gb-message {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  transition: box-shadow var(--transition);
}

.gb-message:hover {
  box-shadow: var(--card-shadow-hover);
}

.gb-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gb-msg-name {
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.gb-msg-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.gb-msg-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.gb-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.gb-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.gb-empty p {
  font-family: var(--font-body);
  font-size: 0.92rem;
}

/* ── VISITOR COUNTER ── */
.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  padding: 0.25rem 0.6rem;
  background: var(--bg-alt);
  border-radius: 980px;
  border: 1px solid var(--border);
}

.visitor-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34c759;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── MOBILE ── */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 52px; left: 0; right: 0;
    background: rgba(250,250,250,0.95);
    backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
  }
  .hamburger { display: flex; }
  .section-inner { padding: 3.5rem 1.5rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .glance-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .hero h1 { font-size: 2.4rem; }
  .gb-msg-header { flex-direction: column; gap: 0.2rem; }
  .visitor-counter { display: none; }
}
