/* Font is loaded via <link> in HTML for reliability. */

:root {
  --bg: #000000;
  --bg-gradient: radial-gradient(circle at 50% -20%, rgba(120, 119, 198, 0.15), rgba(0, 0, 0, 0) 60%),
                 radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.08), rgba(0, 0, 0, 0) 50%);
  --card-bg: rgba(24, 24, 27, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 255, 255, 0.2);
  --text: #ffffff;
  --text-muted: #a1a1aa;
  --accent: #ffffff;
  --accent-invert: #000000;
  --radius: 20px;
  --radius-lg: 32px;
  --max-width: 1040px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1, "onum" 0;
}

/* Force consistent digits (e.g. 2026) */
.project-year,
.site-footer,
.site-footer * {
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1, "onum" 0;
}

h1, h2, h3, h4, p, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

.menu-toggle {
  display: flex;
  align-items: center;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.menu-toggle:hover {
  color: var(--text);
}

.nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 20px 24px;
  background: #09090b;
  border-bottom: 1px solid var(--card-border);
}

.nav.is-open {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

@media (min-width: 640px) {
  .menu-toggle { display: none; }
  .nav {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 32px;
    padding: 0;
    background: transparent;
    border: none;
  }
}

/* Hero Section */
.intro {
  padding: 100px 0 60px;
  min-height: 65vh;
  display: flex;
  align-items: center;
}

.hero-card {
  /* Glassmorphism card */
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: 0 24px 40px -12px rgba(0,0,0,0.5);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "photo content";
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  grid-area: content;
}

.hero-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0;
}

.hero-profile-card {
  width: clamp(240px, 26vw, 292px);
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  align-self: end;
  grid-area: photo;
}

.hero-profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--avatar-position, 50% 50%);
  background: rgba(0, 0, 0, 0.35);
}

.name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tagline {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 48ch;
  margin-bottom: 0;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-invert);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--card-border-hover);
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* Bento Grid Projects */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* First card spans two columns for a bento feel */
  .project-card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 767px) {
  .hero-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "content";
    justify-items: stretch;
    gap: 18px;
  }

  .hero-profile-card {
    width: min(320px, 100%);
    order: -1;
  }

  .tagline {
    max-width: 100%;
  }
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 100%;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 0%), rgba(255,255,255,0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.project-card-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.project-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.project-card-header h3 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-year {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project-description {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1rem;
  line-height: 1.6;
  flex: 1;
}

.project-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags li {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d4d4d8;
  background: rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 8px;
}

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

.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--card-border-hover);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.project-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Contacts */
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.contact-list a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.contact-list a:hover {
  color: var(--text);
}

/* Project Detail Page */
.page {
  padding-top: 40px;
  padding-bottom: 80px;
}

.breadcrumbs {
  margin-bottom: 32px;
}

.breadcrumbs a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

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

.project-hero {
  margin-bottom: 48px;
}

.project-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.project-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 24px;
}

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

.project-content {
  display: grid;
  gap: 40px;
}

.project-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
}

.key-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-top: 6px;
  padding-bottom: 6px;
}

.key-points::before {
  content: "";
  position: absolute;
  left: 9.5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(148, 163, 184, 0.35);
}

.key-points li {
  padding-left: 28px;
  position: relative;
  font-size: 1.05rem;
  color: #e4e4e7;
}

.key-points li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.experience-card .key-points {
  padding-top: 10px;
  padding-bottom: 10px;
}

.experience-card .xp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.experience-card .xp-company {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.experience-card .xp-dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.experience-card .xp-role {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.experience-card .xp-points {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.experience-card .xp-points li {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

.media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,0.5);
}

.media-img {
  display: block;
  width: 100%;
  height: auto;
}

.media-placeholder {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 10px, transparent 10px, transparent 20px);
}

.media figcaption {
  padding: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
}

/* Footer */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
