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

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #555555;
  --dim: #999999;
  --border: #e8e8e8;
  --tag-bg: #f0f0f0;
  --tag-text: #333;
  --accent: #111111;
  --accent-hover: #333;
  --radius: 12px;
  --font: 'Inter', sans-serif;
  --mono: 'Courier New', monospace;
  --max: 1100px;
}

html { scroll-behavior: smooth; }

/* ===========================
   Top bar
=========================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 52px;
}

.topbar-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar-tab {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0.85rem;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.topbar-tab:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
  text-decoration: none;
}

.topbar-tab.active {
  color: var(--text);
  background: rgba(0,0,0,0.06);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 100px;
}

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

/* ===========================
   Page container
=========================== */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================
   Sections
=========================== */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
  /* reveal */
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(.25,.46,.45,.94), transform 0.6s cubic-bezier(.25,.46,.45,.94);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section:last-child { border-bottom: none; }

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--dim);
  margin-bottom: 1.25rem;
}

.section p {
  color: var(--muted);
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
}

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

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

/* ===========================
   Hero
=========================== */
.hero-section {
  min-height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.scroll-hint {
  position: absolute;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.scroll-hint:hover { color: var(--text); }

.scroll-hint svg {
  width: 18px;
  height: 18px;
  animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3.5rem;
}

.hero-text { flex: 1; }

.hero-text h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}

.wave {
  display: inline-block;
  animation: wave 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%,100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
}

.hero-sub {
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 !important;
}

/* Terminal */
.terminal {
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0 1.1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-width: 420px;
}

.terminal-bar {
  background: #2d2d2d;
  padding: 0.5rem 0.75rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-body {
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: #f0f0f0;
  display: flex;
  align-items: center;
  min-height: 2.4rem;
}

.t-prompt {
  color: #28c840;
  white-space: nowrap;
}

.t-typed {
  color: #f0f0f0;
}

.t-cursor {
  color: #f0f0f0;
  animation: blink 1s step-end infinite;
  line-height: 1;
  margin-left: 1px;
}

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

/* Photo slider */
.hero-photo-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.photo-slider {
  position: relative;
  width: 260px;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f0f0f0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.photo-slider .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.photo-slider .slide.active {
  opacity: 1;
}

.slider-dots {
  display: flex;
  gap: 0.4rem;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.slider-dot.active {
  background: var(--text);
  transform: scale(1.2);
}

/* ===========================
   Timeline (Experience)
=========================== */
.timeline { display: flex; flex-direction: column; gap: 1.25rem; }

.tl-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.tl-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.tl-body { flex: 1; }

.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.1rem;
}

.tl-org { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.tl-date { font-size: 0.78rem; color: var(--dim); white-space: nowrap; }
.tl-role { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }

.tl-bullets { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.tl-bullets li {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.55;
}
.tl-bullets li::before { content: '–'; position: absolute; left: 0; color: var(--dim); }

/* ===========================
   Education
=========================== */
.edu-list { display: flex; flex-direction: column; gap: 0; }

.edu-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.edu-row:last-child { border-bottom: none; padding-bottom: 0; }
.edu-row:first-child { padding-top: 0; }

.edu-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}

.edu-body { flex: 1; }

.edu-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.15rem;
}

.edu-school { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.edu-date { font-size: 0.75rem; color: var(--dim); white-space: nowrap; }
.edu-degree { font-size: 0.83rem; color: var(--muted); margin-bottom: 0.3rem; }
.edu-courses { font-size: 0.75rem; color: var(--dim); line-height: 1.5; }

/* ===========================
   Skills
=========================== */
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skills-wrap span {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.28rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
  cursor: default;
}

.skills-wrap span:hover {
  background: #e8e8e8;
  border-color: #ccc;
}

/* ===========================
   Projects
=========================== */
.projects-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pill {
  display: inline-block;
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
}

.projects-header h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.projects-header p {
  font-size: 0.92rem;
  color: var(--muted);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.proj-card {
  background: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  /* reveal */
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.15s;
}

.proj-card.visible { opacity: 1; transform: translateY(0); }
.proj-card:hover { background: #fafafa; }

/* remove double borders on grid edges */
.proj-card:nth-child(2n) { border-right: none; }
.proj-card:nth-last-child(-n+2) { border-bottom: none; }

/* Thumbnails */
.proj-thumb {
  height: 140px;
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  position: relative;
  overflow: hidden;
}

.campus  { background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); }
.autoparts { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.webstore { background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%); }
.mobile { background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%); }

.proj-thumb-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.proj-meta {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.proj-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.proj-top strong { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.proj-year { font-size: 0.72rem; color: var(--dim); white-space: nowrap; }

.proj-meta p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 !important;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
}

.proj-tags span {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.proj-links { display: flex; gap: 0.4rem; margin-top: 0.25rem; }

.proj-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--text);
  color: #fff !important;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 5px;
  text-decoration: none !important;
  transition: background 0.15s;
}

.proj-btn:hover { background: #333; }

/* ===========================
   Contact
=========================== */
.contact-section {
  text-align: center;
  padding: 5rem 0;
}

.contact-section h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0.75rem 0 0.85rem;
}

.contact-section p {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}

.contact-section a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===========================
   Bottom dock
=========================== */
.dock {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.dock-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #666;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  position: relative;
  text-decoration: none;
}

.dock-item svg { width: 20px; height: 20px; }

.dock-item:hover {
  background: rgba(0,0,0,0.07);
  color: #111;
  transform: translateY(-2px);
}

.dock-item.active { color: #111; background: rgba(0,0,0,0.06); }

/* Tooltip */
.dock-item::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: #111;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}

.dock-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 768px) {

  /* Base font smaller on mobile */
  body { font-size: 15px; }

  /* Topbar */
  .topbar { padding: 0 1rem; }
  .topbar-name { display: none; }
  .topbar-nav { gap: 0; }
  .topbar-tab { padding: 0.3rem 0.55rem; font-size: 0.75rem; }

  /* Page padding */
  .page { padding: 0 1rem; }

  /* Sections */
  .section { padding: 2.5rem 0; }

  /* Hero — photo on top, text below */
  .hero-section { justify-content: flex-start; padding-top: 2rem; }
  .hero-content {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }

  .hero-text h1 { font-size: 1.9rem; }
  .hero-sub { font-size: 0.9rem; }

  /* Photo slider */
  .photo-slider {
    width: 220px;
    height: 280px;
  }

  /* Terminal */
  .terminal { max-width: 100%; }
  .terminal-body { font-size: 0.78rem; flex-wrap: wrap; }
  .t-prompt { font-size: 0.72rem; }

  /* Scroll hint */
  .scroll-hint { bottom: 4.5rem; }

  /* Timeline */
  .tl-top { flex-direction: column; gap: 0.1rem; }
  .tl-date { font-size: 0.72rem; }

  /* Education */
  .edu-top { flex-direction: column; gap: 0.1rem; }
  .edu-date { font-size: 0.72rem; }

  /* Projects */
  .projects-grid { grid-template-columns: 1fr; }
  .proj-card { border-right: none !important; }
  .proj-card:nth-last-child(-n+2) { border-bottom: 1px solid var(--border) !important; }
  .proj-card:last-child { border-bottom: none !important; }
  .projects-header h2 { font-size: 1.5rem; }

  /* Skills */
  .skills-wrap span { font-size: 0.75rem; padding: 0.25rem 0.6rem; }

  /* Contact */
  .contact-section h2 { font-size: 1.6rem; }

  /* Dock */
  .dock { padding: 0.5rem 0.75rem; gap: 0; bottom: 1rem; }
  .dock-item { width: 38px; height: 38px; }
  .dock-item::after { display: none; }
}
