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

:root {
  --bg: #f7f5f2;
  --ink: #1a1814;
  --muted: #9e9a94;
  --accent: #c8502a;
  --line: #e2ddd8;
  --card: #efece8;
}

[data-theme="dark"] {
  --bg: #111008;
  --ink: #e8e4de;
  --muted: #56524c;
  --accent: #d4613a;
  --line: #252219;
  --card: #1a1710;
}

html { scroll-behavior: smooth; }

/* ── SCROLL PROGRESS ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 300;
  transition: width 0.08s linear;
}

body {
  transition: background-color 0.3s, color 0.3s;

  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.4rem 4rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: fadeDown 0.6s 0.1s forwards;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  padding: 4px 6px;
  margin-left: 1rem;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--ink); }

/* ── TYPED CURSOR ── */
.typed-cursor {
  display: inline-block;
  width: 1px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── COPY BUTTON ── */
.contact-link-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.copy-btn {
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 8rem 4rem 4rem;
  gap: 4rem;
}

.hero-text { opacity: 0; animation: fadeUp 0.8s 0.3s forwards; }

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.8rem;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  color: var(--muted);
  font-size: 13px;
  max-width: 38ch;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: gap 0.2s, color 0.2s;
}

.hero-cta:hover { gap: 1rem; color: var(--accent); border-color: var(--accent); }

.hero-visual {
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-wrap {
  position: relative;
  width: 320px;
  height: 380px;
}

.avatar-bg {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: 2px;
  border: 1px solid var(--line);
}

.avatar-bg::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line);
  border-radius: 1px;
}

.avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.initials-text {
  font-family: 'DM Serif Display', serif;
  font-size: 6rem;
  color: var(--line);
  line-height: 1;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  position: absolute;
  inset: 0;
}

.avatar-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.avatar-corner {
  position: absolute;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.avatar-corner.tl { top: 1.2rem; left: 1.2rem; }
.avatar-corner.br { bottom: 1.2rem; right: 1.2rem; text-align: right; }

/* ── SECTION SHARED ── */
section {
  padding: 6rem 4rem;
  border-top: 1px solid var(--line);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.section-num {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
}

h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}

/* ── ABOUT ── */
#about .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 1rem;
}

.about-body p strong {
  color: var(--ink);
  font-weight: 500;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  color: var(--ink);
}

/* ── EXPERIENCE ── */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.exp-company {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 2rem 2rem 1.5rem;
}

.exp-company-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.exp-company-meta {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.exp-company-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--ink);
}

.exp-company-type {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.exp-roles {
  display: flex;
  flex-direction: column;
}

.exp-role {
  display: flex;
  gap: 1.2rem;
  align-items: stretch;
}

.exp-role-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  width: 16px;
  flex-shrink: 0;
}

.exp-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  border: 1.5px solid var(--muted);
  flex-shrink: 0;
}

.exp-role-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.exp-role-line {
  width: 1px;
  flex: 1;
  background: var(--line);
  margin: 4px 0;
  min-height: 20px;
}

.exp-role-body {
  padding-bottom: 1.4rem;
  flex: 1;
}

.exp-role.last .exp-role-body {
  padding-bottom: 0.4rem;
}

.exp-role-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.4;
}

.exp-role-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

/* ── EDUCATION ── */
.edu-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem 3rem;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}

.edu-accent-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: #1E407C;
}

.edu-badge {
  flex-shrink: 0;
  width: 72px;
}

.edu-badge svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(30,64,124,0.18));
}

.edu-body {
  flex: 1;
}

.edu-school {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.edu-degree {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.edu-focus {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1rem;
}

.edu-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.edu-detail-chip {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1E407C;
  background: rgba(30,64,124,0.07);
  border: 1px solid rgba(30,64,124,0.18);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
}

/* ── SKILLS ── */
#skills .skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skill-item {
  background: var(--bg);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: background 0.2s;
  cursor: default;
}

.skill-item:hover { background: var(--card); }

.skill-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.skill-name {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.skills-note {
  margin-top: 2rem;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── PROJECTS ── */
#projects .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.project-card:hover::before { transform: scaleX(1); }
.project-card:hover { border-color: var(--muted); transform: translateY(-2px); }

.project-tag {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.project-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--ink);
}

.project-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
}

.project-link {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  width: fit-content;
  transition: color 0.2s, border-color 0.2s;
}

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

/* ── RECIPES ── */
.recipes-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.recipes-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 2rem;
}

.recipe-card {
  background: var(--bg);
  cursor: pointer;
  transition: background 0.2s;
}
.recipe-card:hover { background: var(--card); }
.recipe-card.open { background: var(--card); }

.recipe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.8rem;
  gap: 1rem;
}

.recipe-header-left { flex: 1; }

.recipe-tag {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  margin-bottom: 0.4rem;
  border: 1px solid;
}
.recipe-tag.savory { color: var(--accent); border-color: var(--accent); background: rgba(200,80,42,0.06); }
.recipe-tag.sweet  { color: #a07040; border-color: #c8a060; background: rgba(200,160,96,0.08); }

.recipe-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 0.2rem;
}

.recipe-subtitle {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.recipe-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.recipe-stat {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.recipe-chevron {
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.3s;
  width: 20px;
  text-align: center;
}
.recipe-card.open .recipe-chevron { transform: rotate(45deg); }

.recipe-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease;
}
.recipe-card.open .recipe-body { max-height: 3000px; }

.recipe-two-col {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2rem;
  padding: 0 1.8rem 1.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.recipe-sub-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.recipe-ingredients ul,
.recipe-steps ol {
  padding-left: 1.2rem;
  margin: 0;
}

.recipe-ingredients li,
.recipe-steps li {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.25rem;
}

.recipe-notes {
  margin: 0 1.8rem 1.8rem;
  padding: 1rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}
.recipe-notes-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.recipes-attribution {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

@media (max-width: 768px) {
  .recipe-header { padding: 1.2rem; flex-wrap: wrap; }
  .recipe-header-right { gap: 0.6rem; }
  .recipe-stat { display: none; }
  .recipe-two-col { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.2rem; }
  .recipe-notes { margin: 0 1.2rem 1.2rem; }
}

/* ── CONTACT ── */
#contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.contact-left h2 { margin-bottom: 1rem; }

.contact-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 40ch;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}

.contact-link:hover {
  border-color: var(--muted);
  background: var(--bg);
}

.contact-link-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.contact-link-icon svg { width: 18px; height: 18px; }

.contact-link-body { flex: 1; }
.contact-link-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
.contact-link-value { font-size: 13px; color: var(--ink); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy { font-size: 11px; color: var(--muted); letter-spacing: 0.05em; }

.footer-back {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-back:hover { color: var(--ink); }

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

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
}

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

/* Reduce animations on mobile for better performance */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Reduce animations on touch devices */
@media (hover: none) and (pointer: coarse) {
  nav { animation: none; opacity: 1; }
  .hero-text { animation: none; opacity: 1; }
  .hero-visual { animation: none; opacity: 1; }

  .project-card::before {
    display: none;
  }
  .project-card:hover {
    transform: none;
    border-color: var(--line);
  }

  /* Ensure buttons are touch-friendly (minimum 44x44px) */
  button {
    min-height: 44px;
    min-width: 44px;
  }

  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Remove hover transitions on touch */
  .nav-links a { transition: none; }
  .hero-cta { transition: none; }
  .footer-back { transition: none; }
}

/* Optimize font loading for better performance */
html {
  font-display: swap;
}

@supports (font-variant-ligatures: common-ligatures) {
  body {
    font-variant-ligatures: common-ligatures;
  }
}

/* ── RESPONSIVE ── */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  /* NAV */
  nav {
    padding: 1rem 1.5rem;
    gap: 1rem;
    overflow: hidden;
  }
  .nav-logo { font-size: 0.9rem; flex-shrink: 0; }
  .nav-links {
    gap: 1.2rem;
    font-size: 11px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links li { flex-shrink: 0; }
  .theme-toggle { flex-shrink: 0; }

  /* HERO */
  #hero {
    grid-template-columns: 1fr;
    padding: 6rem 1.5rem 3rem;
    gap: 2rem;
    min-height: auto;
  }
  .hero-text { margin-bottom: 1rem; }
  .hero-eyebrow { margin-bottom: 0.8rem; }
  .hero-eyebrow::before { width: 1.5rem; }
  h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1.2rem; }
  .hero-desc { font-size: 12px; margin-bottom: 1.5rem; }
  .hero-visual { display: flex; order: -1; justify-content: center; }
  .avatar-wrap { width: 140px; height: 160px; }
  .initials-text { font-size: 3.5rem; }
  .avatar-corner { display: none; }

  /* SECTIONS */
  section { padding: 3.5rem 1.5rem; border-top: 1px solid var(--line); }
  .section-header { gap: 1rem; margin-bottom: 2.5rem; }
  .section-num { font-size: 10px; }
  h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }

  /* ABOUT */
  #about .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-body p { font-size: 12px; }
  .stat-card { padding: 1.2rem; }
  .stat-label { font-size: 9px; }
  .stat-value { font-size: 1.2rem; }

  /* EXPERIENCE */
  .exp-company { padding: 1.5rem 1.5rem 1rem; }
  .exp-company-name { font-size: 1.1rem; }
  .exp-role-title { font-size: 12px; }
  .exp-role-meta { font-size: 10px; }

  /* EDUCATION */
  .edu-card { flex-direction: column; gap: 1.5rem; padding: 2rem 1.5rem 2rem 2rem; }
  .edu-badge { width: 56px; }
  .edu-school { font-size: 1.2rem; }

  /* SKILLS */
  #skills .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1px;
  }
  .skill-item { padding: 1rem 1.2rem; }
  .skill-name { font-size: 11px; }
  .skill-dot { width: 5px; height: 5px; }

  /* PROJECTS */
  #projects .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .project-card { padding: 1.5rem; }
  .project-tag { font-size: 9px; }
  .project-title { font-size: 1.1rem; }
  .project-desc { font-size: 11px; }
  .project-link { font-size: 10px; }

  /* CONTACT */
  #contact {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .contact-left h2 { margin-bottom: 0.8rem; }
  .contact-sub { font-size: 12px; }
  .contact-link {
    padding: 1rem 1.2rem;
    min-height: 50px;
  }
  .contact-link-icon { width: 28px; height: 28px; }
  .contact-link-icon svg { width: 16px; height: 16px; }
  .contact-link-label { font-size: 9px; }
  .contact-link-value { font-size: 12px; }

  /* FOOTER */
  footer {
    padding: 1.5rem;
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }
  .footer-copy { font-size: 10px; }
  .footer-back { font-size: 10px; }

  /* SECRET/PASSWORD */
  .password-input-group {
    flex-direction: column;
    max-width: 100%;
  }
  .password-label { margin-bottom: 0.5rem; }
  .password-input { width: 100%; }
  .password-submit { width: 100%; }
  .secret-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .secret-item { padding: 1.5rem; }
  .secret-item h4 { font-size: 1rem; }
  .secret-item p { font-size: 11px; }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  /* NAV */
  nav {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .nav-logo { font-size: 0.8rem; }
  .nav-links {
    gap: 0.8rem;
    font-size: 9px;
  }

  /* HERO */
  #hero {
    padding: 5rem 1rem 2rem;
    gap: 1.5rem;
  }
  h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); margin-bottom: 1rem; }
  .hero-desc { font-size: 11px; margin-bottom: 1rem; }
  .hero-cta { font-size: 10px; }

  /* SECTIONS */
  section { padding: 2.5rem 1rem; }
  .section-header { gap: 0.8rem; margin-bottom: 2rem; }
  h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

  /* ABOUT */
  .about-body p { font-size: 11px; line-height: 1.6; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1rem; }

  /* SKILLS */
  #skills .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
  .skill-item { padding: 0.8rem 1rem; }
  .skill-name { font-size: 10px; }

  /* PROJECTS */
  .project-card { padding: 1.2rem; }
  .project-title { font-size: 0.95rem; }
  .project-desc { font-size: 10px; }

  /* CONTACT */
  .contact-link {
    padding: 0.8rem 1rem;
    min-height: 44px;
    gap: 0.8rem;
  }
  .contact-link-icon { width: 24px; height: 24px; }
  .contact-link-icon svg { width: 14px; height: 14px; }
  .contact-link-label { font-size: 8px; }
  .contact-link-value { font-size: 11px; }

  /* FOOTER */
  footer { padding: 1.2rem 1rem; }
  .footer-copy { font-size: 9px; }
  .footer-back { font-size: 9px; }

  /* SECRET */
  .password-submit {
    padding: 0.7rem 1rem;
    font-size: 11px;
  }
  .secret-unlocked h3 { font-size: 1.4rem; }
  .secret-item { padding: 1.2rem; }
}

/* Small mobile (360px and below) */
@media (max-width: 360px) {
  nav { padding: 0.6rem 0.8rem; }
  .nav-logo { font-size: 0.7rem; }
  .nav-links { gap: 0.6rem; font-size: 8px; }

  #hero {
    padding: 4.5rem 0.8rem 1.5rem;
  }
  h1 { font-size: clamp(1.5rem, 4vw, 2rem); }

  section { padding: 2rem 0.8rem; }
  .section-header { margin-bottom: 1.5rem; }

  .password-input-group { gap: 0.6rem; }
  .password-input { font-size: 12px; }

  .contact-link { gap: 0.6rem; }
  .contact-link-icon { width: 20px; height: 20px; }
}

/* ── SECRET ── */
#secret .secret-content {
  max-width: 50rem;
  margin: 0 auto;
}

.secret-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 2rem;
  text-align: center;
}

.password-input-group {
  display: flex;
  gap: 1rem;
  max-width: 300px;
  margin: 0 auto 1rem;
}

.password-input {
  flex: 1;
  padding: 0.8rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s;
}

.password-input:focus { border-color: var(--accent); }

.password-submit {
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.password-submit:hover { background: #b8381f; }

.password-error {
  color: #d32f2f;
  font-size: 12px;
  text-align: center;
  margin: 0;
}

.secret-unlocked h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--ink);
  margin-bottom: 1rem;
  text-align: center;
}

.secret-unlocked > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  margin-bottom: 3rem;
}

.secret-logout {
  display: block;
  margin: 0 auto 2rem;
  padding: 0.6rem 1.2rem;
  background: var(--muted);
  color: white;
  border: none;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}

.secret-logout:hover {
  background: #666;
}

.secret-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.secret-item {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 2rem;
  border-radius: 2px;
}

.secret-item h4 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.secret-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.password-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
