:root {
  --bg: #fafafa;
  --bg2: #f5f5f5;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.08);
  --gold: #c9a96e;
  --gold-dim: rgba(201,169,110,0.1);
  --gold-glow: rgba(201,169,110,0.12);
  --text: #1a1a1a;
  --text-muted: #666666;
  --text-dim: #999999;
  --white: #2c2c2c;
  --nav-width: 340px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

/* Custom cursor */
.cursor {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

body:has(a:hover) .cursor-dot,
body:has(button:hover) .cursor-dot,
body:has([role="button"]:hover) .cursor-dot {
  width: 20px;
  height: 20px;
  background: var(--gold);
  opacity: 0.85;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(201,169,110,0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out, width 0.25s ease, height 0.25s ease, opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  background: transparent;
}
body:has(a:hover) .cursor-ring,
body:has(button:hover) .cursor-ring,
body:has([role="button"]:hover) .cursor-ring {
  width: 32px; height: 32px;
  background: transparent;
  border-color: var(--gold);
  opacity: 1;
}

/* Ambient glow background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient::before {
  content: '';
  position: absolute;
  top: -20%; left: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(ellipse, rgba(201,169,110,0.02) 0%, transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.ambient::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(ellipse, rgba(100,120,200,0.01) 0%, transparent 70%);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}

/* Layout */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  gap: 80px;
  align-items: flex-start;
}

/* LEFT PANEL */
.left {
  width: var(--nav-width);
  min-width: var(--nav-width);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 80px 0;
}

.left-top {}

.name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 3.5vw, 3rem);
  font-weight: 400;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.role {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}

.tagline {
  font-size: 0.95rem;
  color: var(--gold);
  line-height: 1.65;
  max-width: 280px;
}

/* Nav */
.nav {
  margin-top: 52px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
  transition: color 0.25s, gap 0.25s;
  width: fit-content;
}

.nav-line {
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
  color: var(--gold);
  gap: 20px;
}

.nav-item:hover .nav-line,
.nav-item.active .nav-line {
  width: 52px;
}

/* Social links */
.socials {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-bottom: 80px;
}

.social-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
}

.social-link:hover {
  color: var(--gold);
  transform: translateY(-2px);
}

.social-link svg {
  width: 24px; height: 24px;
  fill: currentColor;
}

/* RIGHT PANEL */
.right {
  flex: 1;
  padding: 80px 0 120px;
  min-width: 0;
}

/* Sections */
section {
  margin-bottom: 100px;
  scroll-margin-top: 80px;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* About */
.about-card {
  padding: 32px;
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 10px;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
}

.about-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(201, 169, 110, 0.3);
}

.about-text {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 560px;
}

.about-text p + p { margin-top: 18px; }

.about-text a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,169,110,0.3);
  transition: border-color 0.2s;
}
.about-text a:hover { border-color: var(--gold); }

/* Experience link wrapper — mirrors project-card hover behavior */
.exp-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
}

.exp-link:hover .exp-item {
  background: var(--surface);
  border-color: var(--border);
}

.exp-link:hover .exp-title {
  color: var(--gold);
}

.exp-link:hover .exp-arrow {
  transform: translate(4px, -4px);
  color: var(--gold);
}

.exp-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.exp-arrow {
  color: var(--text-dim);
  transition: transform 0.25s, color 0.25s;
  flex-shrink: 0;
  margin-top: 3px;
}

/* Experience */
.exp-group-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 4px 12px 4px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.exp-group-label::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--border);
}
.exp-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.exp-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0 28px;
  padding: 20px 24px;
  margin: 0 -24px;
  border-radius: 10px;
  transition: background 0.3s;
  border: 1px solid transparent;
  cursor: none;
}

.exp-item--link { cursor: none; }

.exp-thumb {
  width: 100%;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 10px;
}

.exp-thumb img {
  width: 100%;
  height: 100%;
  max-height: 120px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.exp-item:hover {
  background: var(--surface);
  border-color: var(--border);
}

.exp-item:hover .exp-title {
  color: var(--gold);
}

.exp-meta {
  padding-top: 3px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exp-period {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.exp-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--white);
  transition: color 0.3s;
  margin-bottom: 4px;
}

.exp-company {
  font-size: 0.83rem;
  color: var(--gold);
  font-weight: 400;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.exp-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

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

.tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 3px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(201,169,110,0.2);
}

/* Projects */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  padding: 24px;
  margin: 0 -24px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.3s;
  border: 1px solid transparent;
}

.project-card:hover {
  background: var(--surface);
  border-color: var(--border);
}

.project-card:hover .project-title {
  color: var(--gold);
}

.project-card:hover .project-arrow {
  transform: translate(4px, -4px);
}

.project-thumb {
  width: 160px;
  height: 100px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--text-dim);
}

.project-content {}

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

.project-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--white);
  transition: color 0.3s;
}

.project-arrow {
  color: var(--text-dim);
  transition: transform 0.25s, color 0.25s;
  flex-shrink: 0;
  margin-top: 2px;
}

.project-card:hover .project-arrow { color: var(--gold); }

.project-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.skill-group {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.3s;
}

.skill-group:hover { border-color: rgba(201,169,110,0.25); }

.skill-group-title {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-list li::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Contact */
.contact-wrapper {
  max-width: 480px;
}

.contact-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 32px;
}

.contact-text a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,169,110,0.3);
  transition: border-color 0.2s;
}

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

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border: 1px solid rgba(201,169,110,0.4);
  border-radius: 4px;
  color: var(--gold);
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  transition: background 0.2s, border-color 0.2s, gap 0.2s;
}

.contact-email:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  gap: 16px;
}

/* Footer */
.footer {
  padding-top: 40px;
  border-top: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Divider */
.divider {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* Resume link */
.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}

.resume-link:hover {
  color: var(--gold);
  gap: 12px;
}

/* Hide custom cursor on touch devices (no fine pointer), regardless of width */
@media (hover: none), (pointer: coarse) {
  body,
  a,
  button,
  [role="button"],
  input,
  label,
  select,
  textarea,
  [tabindex],
  .exp-item,
  .exp-item--link {
    cursor: auto !important;
  }

  #cursorDot,
  #cursorRing,
  .cursor {
    display: none !important;
  }
}

@media (max-width: 900px) {

  /* Layout */
  .layout {
    flex-direction: column;
    padding: 0 20px;
    gap: 0;
  }

  .left {
    position: static;
    width: 100%;
    min-width: unset;
    height: auto;
    padding: 48px 0 32px;
  }

  .name {
    white-space: nowrap;
  }

  .right {
    padding: 0 0 72px;
  }

  .nav {
    display: none;
  }

  .socials {
    padding-bottom: 0;
  }

  .social-link {
    padding: 8px;
    margin: -8px;
  }

  section {
    margin-bottom: 72px;
  }

  /* About */
  .about-card {
    padding: 24px;
  }

  .about-content {
    gap: 24px;
  }

  .about-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    align-self: center;
  }

  /* EXPERIENCE */
  .exp-item {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px 18px;
    margin: 0;
  }

  .exp-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
  }

  .exp-thumb {
    width: 100%;
    max-width: 100%;
    height: 180px;
    max-height: unset;
    margin-top: 0;
  }

  .exp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* PROJECTS */
  .project-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px 18px;
    margin: 0;
  }

  .project-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 240px;
  }

  .project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .project-header {
    gap: 12px;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* ── Mid-range: two-column cards getting narrow before mobile stacking kicks in ── */
@media (min-width: 601px) and (max-width: 900px) {
  /* At this range the layout has already gone single-column (left panel stacks
     above right), so the right panel is full width but the card grids still
     try to keep the thumbnail column. Collapse them earlier. */
  .exp-item {
    grid-template-columns: 100px 1fr;
    gap: 0 20px;
  }

  .exp-thumb {
    max-height: 90px;
  }

  .project-card {
    grid-template-columns: 130px 1fr;
    gap: 20px;
  }

  .project-thumb {
    width: 130px;
    height: 90px;
    aspect-ratio: unset;
    max-height: unset;
  }
}

/* ── Narrow mobile: fully stack everything ── */
@media (max-width: 600px) {
  .exp-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 16px;
    margin: 0;
  }

  .exp-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: unset;
    margin-top: 0;
  }

  .exp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 16px;
    margin: 0;
  }

  .project-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: unset;
  }

  .about-image {
    max-width: 260px;
  }
}


@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button,
  [role="button"],
  input,
  label,
  select,
  textarea,
  [tabindex] {
    cursor: none !important;
  }
}