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

:root {
  --accent: #2563eb;
  --accent-light: #eff4ff;
  --text: #111;
  --text-secondary: #555;
  --text-tertiary: #888;
  --border: #e8e8e8;
  --bg: #fafafa;
  --card-bg: #fff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.7;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 32px;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.hero-nav-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.hero-nav-links {
  display: flex;
  gap: 24px;
}

.hero-nav-links a {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  animation: fadeUp 0.7s ease-out 0.3s both;
}

h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-intro {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 12px;
  max-width: 580px;
}

.hero-sub {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 540px;
}

.hero-bottom {
  position: absolute;
  bottom: 36px;
  left: 32px;
  right: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 2;
  animation: fadeIn 0.8s ease-out 0.8s both;
}

.hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-chip {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 100px;
}

.scroll-cue {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
  animation: float 3s ease-in-out infinite;
}

.scroll-cue:hover {
  color: var(--text);
  opacity: 1;
}

.scroll-cue svg {
  flex-shrink: 0;
}

/* ── Sections ── */
section {
  padding: 72px 0 0;
}

.projects {
  padding-top: 80px;
}

h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 36px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-number {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: 4px;
  position: relative;
  top: -2px;
}

/* ── Project Cards ── */
.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  transition: border-color 0.3s, box-shadow 0.3s;
  animation: fadeUp 0.6s ease-out both;
  animation-delay: calc(0.15s * var(--delay));
}

.project-card:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

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

.project-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.project-header .project-date {
  margin-left: auto;
}

.project-header h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
}

.project-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 3px;
}

.project-tag-muted {
  color: var(--text-tertiary);
  background: #f0f0f0;
}

.project-tag-wip {
  color: #d97706;
  background: #fef3c7;
}

.project-card-small {
  grid-template-columns: 1fr;
}

.project-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}

.project-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.project-url {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.project-meta .project-url {
  margin-bottom: 0;
}

.project-text > .project-date {
  display: block;
  margin-bottom: 12px;
}

.project-urls {
  display: flex;
  gap: 16px;
}

.project-visual img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.placeholder-icon {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-icon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.project-oneliner {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.project-visual {
  display: flex;
  align-items: center;
}

.placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f5f5f5 0%, #eee 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #ccc;
  letter-spacing: 0.05em;
}

/* ── Background ── */
.background-content {
  margin-bottom: 32px;
}

.background-content p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

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

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

.background-thesis {
  font-size: 0.95rem !important;
  color: var(--text) !important;
  font-weight: 500;
  font-style: italic;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  margin-top: 16px !important;
}

.extras {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.extra-item {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.extra-label {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  width: 100px;
  padding-top: 2px;
}

/* ── Skills ── */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  transition: border-color 0.2s, color 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Footer ── */
footer {
  padding: 56px 0 80px;
  margin-top: 72px;
  border-top: 1px solid var(--border);
}

.footer-heading {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.footer-contact {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-contact a {
  font-size: 0.85rem;
  color: var(--accent);
}

.signoff {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: 520px;
}

/* ── Mobile ── */
@media (max-width: 700px) {
  .hero {
    padding: 0 20px;
  }

  .hero-nav {
    padding: 20px;
  }

  .hero-nav-links {
    gap: 16px;
  }

  .hero-bottom {
    left: 20px;
    right: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .hero-chips {
    gap: 6px;
  }

  main {
    padding: 0 20px;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .project-card {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .project-visual {
    order: -1;
  }

  .placeholder {
    aspect-ratio: 16 / 9;
  }

  section {
    padding-top: 48px;
  }

  footer {
    padding: 40px 0 60px;
    margin-top: 48px;
  }

  .extra-item {
    flex-direction: column;
    gap: 2px;
  }

  .extra-label {
    width: auto;
  }
}
