:root {
  /* Backgrounds */
  --bg:               #0a0a08;
  --bg2:              #111110;
  --surface:          #1a1a17;

  /* Brand accent */
  --gold:             #c9a84c;
  --gold-light:       #e8c97a;   

  /* Text hierarchy — dark theme */
  --cream:            #f5f2e8;   /* Was #f0ead6 - slightly lighter for better contrast */
  --text-secondary:   #e8e2d4;   /* Was #d8d2bc - lighter for better readability */
  --text-dim:         #c4bea8;   /* Was #b8b29c - improved contrast ~7:1 */
  --muted:            #a8a290;   /* Was #9c9c8e - better contrast on dark backgrounds */

  /* Feedback */
  --error:            #e87370;   

  /* Structural */
  --border:           rgba(201, 168, 76, 0.18);
  --nav-bg:           rgba(10, 10, 8, 0.93);
  --shadow:           0 8px 32px rgba(0, 0, 0, 0.35);

  /* Typography */
  --font-display: 'Cormorant Garamond', serif;
  --font-ui:      'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Transitions */
  --t-fast:   0.2s ease;
  --t-base:   0.3s ease;
  --t-slow:   0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --t-theme:  background 0.45s ease, color 0.45s ease,
              border-color 0.45s ease;
}

/* ── 2. LIGHT MODE ──────────────────────────────────────────── */

html.light {
  /* Backgrounds */
  --bg:               #f5f2ea;
  --bg2:              #ede9de;
  --surface:          #e4dfd2;

  /* Brand accent — darkened so gold text clears 4.5:1 on all light surfaces */
  --gold:             #6b5018;   /* ~6.9:1 on --bg ✓  (was #9e7a28 = 3.4:1 ✗) */
  --gold-light:       #8a6820;   /* hover accent */
  
  /* Better contrast for overlays and buttons in light mode */
  --overlay-bg:       rgba(26, 24, 18, 0.95); /* Darker overlay for better contrast */
  --modal-bg:         rgba(245, 242, 234, 0.98); /* Light modal background */

  /* Text hierarchy — light theme */
  --cream:            #1a1812;   /* primary text   ~14:1 on --bg  ✓ */
  --text-secondary:   #2e2b22;   /* body copy      ~12.9:1 on --bg ✓ */
  --text-dim:         #4a4438;   /* supporting     ~8.5:1 on --bg ✓ */
  --muted:            #5c5548;   /* labels/meta    ~7.1:1 on --bg ✓ (was #7a7465 = 3.9:1 ✗) */

  /* Feedback — darkened for light backgrounds */
  --error:            #b03530;   /* ~5.5:1 on --bg  ✓ (was #c9504c = 3.5:1 ✗) */

  /* Structural */
  --border:           rgba(107, 80, 24, 0.22);
  --nav-bg:           rgba(245, 242, 234, 0.95);
  --shadow:           0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Light theme - project cards border for visibility */
html.light .project-card {
  border: 2px solid #6b5018;;
}

/* Smooth theme transitions */
body,
header,
nav,
main,
section,
article,
aside,
footer,
.project-card,
.modal-overlay,
.skill-item,
.contact-form input,
.contact-form textarea,
.contact-form select,
.portrait-frame,
.detail-icon,
.social-link,
.about-bio,
.modal-body,
.contact-tagline,
.hero-desc,
.about-sub,
.project-desc {
  transition: var(--t-theme);
}

/* ── 3. RESET & BASE ────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Prevent layout shift from scrollbar appearing */
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 500;
  overflow-x: hidden;
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 4. SKIP LINK */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  background: var(--gold);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* ── 5. FOCUS VISIBLE */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── 6. CUSTOM CURSOR - REMOVED ──────────────────────────────── */
/* Cursor elements removed - using default browser cursor */

/* ── 7. GRAIN OVERLAY */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9997;
}

/* ── 8. SCROLLBAR */
::-webkit-scrollbar       { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ── 9. HEADER / NAV */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.4s, border-color 0.4s;
}

.site-header.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #6b5018;;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--cream);
  text-decoration: none;
  transition: color var(--t-base);
}
.nav-logo span { color: var(--gold); font-style: italic; }
.nav-logo:hover { color: var(--gold); }

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

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--t-base);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width var(--t-base);
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--cream); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { width: 100%; }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── 10. THEME TOGGLE */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid #6b5018;;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base), background 0.45s, transform var(--t-base);
}
.theme-toggle:hover { border-color: var(--gold); transform: scale(1.1); }

.theme-icon {
  font-size: 1rem;
  line-height: 1;
  position: absolute;
  user-select: none;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Dark mode → show ☀️  */
.icon-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
.icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
/* Light mode → show 🌙 */
html.light .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.5); }
html.light .icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

/* ── 11. HAMBURGER */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  position: relative;
  z-index: 9999;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--cream);
  transition: all 0.3s ease;
  transform-origin: center;
  position: relative;
}

/* Cross animation - simpler approach */
.hamburger[aria-expanded="true"] {
  gap: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── 12. MOBILE MENU (native <dialog>) */

.mobile-menu {
  border: none;
  padding: 0;
  margin: 0;
  /* Full-screen takeover */
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh; 
  max-height: 100dvh;
  background: var(--bg);
  z-index: 98; /* Lower than hamburger */
  /* Hidden by default — [open] attr controls visibility */
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}
/* Show when dialog is open */
.mobile-menu[open] { display: flex; }
/* Suppress native ::backdrop (we paint our own bg on the dialog) */
.mobile-menu::backdrop { display: none; }

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.mobile-menu nav a {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color var(--t-base);
}
.mobile-menu nav a:hover { color: var(--gold); }

/* ── 13. HERO */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 80px 3rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(201, 168, 76, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(201, 168, 76, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-line {
  position: absolute;
  top: 0;
  right: 18%;
  width: 1px;
  height: 100vh;
  background: linear-gradient(to bottom, transparent, rgba(201, 168, 76, 0.2), transparent);
  pointer-events: none;
}
.hero-title {
  margin: 0;
  width: 100%;
  max-width: 40rem;
  height: auto;
  aspect-ratio: 16/10;
  margin-left: -3rem;
}
.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}

.hero-desc {
  max-width: 340px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.hero-cta { display: flex; gap: 1.5rem; }

/* Hero content container - wraps title and bottom content */
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100vh - 80px - 5rem);
}

/* ── 14. BUTTONS */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border: 1px solid transparent;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--gold); transform: translateY(-2px); }

/* ── 15. MARQUEE ────────────────────────────────────────────── */
.marquee-section {
  border-top: 1px solid #6b5018;;
  border-bottom: 1px solid #6b5018;;
  padding: 1.2rem 0;
  overflow: hidden;
  background: var(--bg2);
}
/* Pause on reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}
.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee 25s linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.marquee-item {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.marquee-item::after {
  content: '◆';
  color: var(--gold);
  font-size: 0.4rem;
}

/* ── 16. SECTION COMMON */
.page-section { padding: 7rem 3rem; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-label::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--gold);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}
.section-title em { font-style: italic; color: var(--gold); }

/* ── 17. WORK / PORTFOLIO */
#work { background: var(--bg); }

.work-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 4rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.work-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* Portfolio grid  */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  transition: transform var(--t-slow), box-shadow var(--t-base);
  border-radius: 2px;
}
.project-card:hover      { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--gold); z-index: 10; }
.project-card:focus-within { transform: translateY(-6px) scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--gold); z-index: 10; }

.project-card:nth-child(1) { grid-column: span 7; grid-row: span 2; }
.project-card:nth-child(2) { grid-column: span 5; }
.project-card:nth-child(3) { grid-column: span 5; }
.project-card:nth-child(4) { grid-column: span 4; }
.project-card:nth-child(5) { grid-column: span 4; }
.project-card:nth-child(6) { grid-column: span 4; }
.project-card:nth-child(7) { grid-column: span 4; }
.project-card:nth-child(8) { grid-column: span 4; }
.project-card:nth-child(9) { grid-column: span 4; }

.project-thumb {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.project-thumb-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 5px solid #000;
}

.project-thumb-inner img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.9;
  transition: opacity var(--t-base), transform var(--t-base);
}
.project-card:hover .project-thumb-inner img,
.project-card:focus-within .project-thumb-inner img { opacity: 1; transform: scale(1.03); }

/* Card-specific backgrounds removed - using images instead */
.card-1 .project-thumb-inner,
.card-2 .project-thumb-inner,
.card-3 .project-thumb-inner,
.card-4 .project-thumb-inner,
.card-5 .project-thumb-inner,
.card-6 .project-thumb-inner,
.card-7 .project-thumb-inner,
.card-8 .project-thumb-inner,
.card-9 .project-thumb-inner { 
  background: transparent;
}


.project-overlay {
  display: none;
}

.overlay-btn {
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.overlay-btn:hover { 
  background: var(--gold); 
  color: var(--bg); 
  border-color: var(--gold-light);
}

.project-info {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}
.project-category {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.project-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 0.4rem;
}
.project-desc {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.6;
  font-family: var(--font-mono);
}

/* Tap indicator — mobile only */
.tap-indicator {
  display: none;
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 20, 16, 0.55);
  border: 1px solid var(--gold);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
  border-radius: 2px;
}

/* ── 18. MODAL */

.modal-overlay {
  /* Reset browser dialog defaults */
  border: 2px solid #c9a84c;
  padding: 0;
  margin: 0;
  /* Position with explicit margins for border visibility */
  position: fixed;
  top: 5.4rem;
  left: 1rem;
  right: 1rem;
  bottom: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  /* Dark backdrop on the dialog element itself */
  background: var(--modal-bg, rgba(10, 10, 8, 0.96));
  z-index: 200;
  /* Animation: start transparent, .open → opaque */
  opacity: 0;
  transition: opacity 0.4s;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* Suppress native ::backdrop — we paint on the dialog */
.modal-overlay::backdrop { display: none; }

/* Scrollbar styling for modal overlay */
.modal-overlay::-webkit-scrollbar {
  width: 8px;
}

.modal-overlay::-webkit-scrollbar-track {
  background: transparent;
}

.modal-overlay::-webkit-scrollbar-thumb {
  background: #f5f2e8;
  border-radius: 4px;
}

.modal-overlay {
  scrollbar-width: thin;
  scrollbar-color: #f5f2e8 transparent;
}

/* Fade-in state */
.modal-overlay.open { opacity: 1; }

.modal-dialog {
  max-width: 900px;
  margin: 6rem auto 8rem;
  padding: 0 2rem;
  transform: translateY(30px);
  transition: transform var(--t-slow);
}
.modal-overlay.open .modal-dialog { transform: translateY(0); }

.modal-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border: 1px solid #6b5018;;
  background: var(--surface);
  color: var(--cream);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--t-base), background var(--t-base);
  z-index: 201;
  border-radius: 2px;
}
.modal-close:hover { border-color: var(--gold); background: var(--gold); color: var(--bg); }

.modal-hero {
  width: 100%;
  margin-bottom: 3rem;
  overflow: hidden;
  border-radius: 0.5rem;
}
.modal-hero-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.modal-meta {
  display: flex;
  gap: 3rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.modal-meta-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.modal-meta-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cream);
}

.modal-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--cream);
}
.modal-divider {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 2rem 0;
}
.modal-body {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 2;
  color: var(--text-dim);
}
.modal-body p { margin-bottom: 1.5rem; }

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-bottom: 2rem;
}
.modal-tag {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.modal-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 30px;
  transition: all var(--t-med);
  cursor: pointer;
  border: 2px solid transparent;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.modal-btn-primary {
  background: var(--gold) !important;
  color: var(--bg) !important;
  border: 2px solid var(--gold) !important;
}

.modal-btn-primary:hover {
  background: transparent !important;
  color: var(--gold) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.modal-btn-primary:visited {
  color: var(--bg) !important;
}

.modal-btn-primary:visited:hover {
  color: var(--gold) !important;
}

/* ── 19. ABOUT */
#about { background: var(--bg2); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.about-portrait { position: relative; }

.portrait-frame {
  width: 100%;
  padding-top: 120%;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.portrait-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1a1512, #0d0d0a, #1a1008);
  font-size: 10rem;
}
.portrait-accent {
  position: absolute;
  bottom: -1.5rem;
  right: -1.5rem;
  width: 60%;
  height: 60%;
  border: 1px solid var(--gold);
  pointer-events: none;
  z-index: -1;
}
.portrait-badge {
  position: absolute;
  bottom: 3.375rem;
  left: 1.5rem;
  background: var(--bg);
  border: 1px solid #6b5018;;
  padding: 0.8rem 1.2rem;
}
.portrait-badge-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.2rem;
}
.portrait-badge-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
}

.about-bio {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-top: 4rem;
  margin-bottom: 2.5rem;
}
.about-sub {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 2;
  color: var(--text-dim);
  margin-bottom: 3rem;
}

.cta-section { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── 20. SKILLS SECTION */
#skills { background: var(--bg); }

.skills-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-category {
  background: var(--surface);
  padding: 2rem;
  border: 2px solid #6b5018;;
  transition: border-color var(--t-base), transform var(--t-base);
  border-radius: 2px;
}

.skill-category:hover {
  border-color: rgba(201, 168, 76, 0.4);
  transform: translateY(-2px);
}

.skill-category-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-list .skill-item {
  padding: 0.8rem 1rem;
  border: 1px solid #6b5018;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: border-color var(--t-base), color var(--t-base), background var(--t-base);
  background: var(--bg);
}

.skill-list .skill-item:hover { 
  border-color: var(--gold); 
  color: var(--cream); 
  background: rgba(201, 168, 76, 0.05);
}

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

/* ── 21. CONTACT */
#contact { background: var(--bg2); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 6rem;
  align-items: start;
}

.contact-tagline {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.4;
  color: var(--text-dim);
  margin-bottom: 3rem;
}

.contact-details { display: flex; flex-direction: column; gap: 1.5rem; }

.contact-dl {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.contact-dl dt,
.contact-dl dd { margin: 0; padding: 0; }

.contact-detail {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.detail-icon {
  width: 40px;
  height: 40px;
  border: 1px solid #6b5018;;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  border-radius: 2px;
}
.detail-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.detail-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cream);
}

.contact-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-base);
}
.contact-link:hover { color: var(--gold); }

.social-links {
  display: flex;
  gap: 0.8rem;
  margin-top: 2.5rem;
}
.social-link {
  width: 40px;
  height: 40px;
  border: 1px solid #6b5018;;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: border-color var(--t-base), color var(--t-base), background var(--t-base);
  border-radius: 2px;
}
.social-link:hover { border-color: var(--gold); color: var(--gold); background: rgba(201, 168, 76, 0.05); }

/* ── 22. FORM */
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group { position: relative; }

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--form-label, var(--muted));
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--surface);
  border: 1px solid #6b5018;;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.9rem 1rem;
  transition: border-color var(--t-base), background var(--t-base);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 2px;
}
.form-group textarea     { resize: vertical; min-height: 120px; }

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.03);
}
.form-group input.error,
.form-group textarea.error,
.form-group select.error  { border-color: var(--error); }

.form-error {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--error);
  margin-top: 0.4rem;
  display: none;
  letter-spacing: 0.05em;
}
.form-error.show { display: block; }

.form-success {
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--gold);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gold);
  display: none;
  line-height: 1.8;
  text-align: center;
  border-radius: 2px;
}
.form-success.show { display: block; }

.btn-submit {
  background: var(--gold);
  color: var(--bg);
  border: none;
  padding: 1rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background var(--t-base), transform var(--t-base);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  align-self: flex-start;
}
.btn-submit:hover    { background: var(--gold-light); transform: translateY(-2px); }
.btn-submit:disabled { opacity: 0.6; transform: none; pointer-events: none; }

/* ── 23. FOOTER */
.site-footer {
  background: var(--bg);
  border-top: 1px solid #6b5018;;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: left;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--cream);
  letter-spacing: 0.05em;
  text-decoration: none;
}
.footer-logo span { color: var(--gold); font-style: italic; }

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-align: center;
  margin-top: 2rem;
}

.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--t-base);
}
.footer-nav a:hover { color: var(--gold); }

/* ── 24. ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── 25. SCROLL REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible       { opacity: 1; transform: translateY(0); }
.reveal-delay-1       { transition-delay: 0.1s; }
.reveal-delay-2       { transition-delay: 0.2s; }
.reveal-delay-3       { transition-delay: 0.3s; }
.reveal-delay-4       { transition-delay: 0.4s; }

/* Respect user preference */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.visible { transition: none; opacity: 1; transform: none; }
  .hero-bottom { animation: none; opacity: 1; transform: none; }
}

/* ── 26. RESPONSIVE */
@media (max-width: 1024px) {
  .nav-links  { display: none; }
  .hamburger  { 
    display: flex !important; 
    align-items: center;
    gap: 0.5rem;
  }
  .nav-inner  { padding: 1.5rem 2rem; }
  .page-section { padding: 6rem 2rem; }
  .hero-grid   { grid-template-columns: 1fr; gap: 4rem; }
  .about-grid  { grid-template-columns: 1fr; gap: 4rem; }
  .contact-grid      { grid-template-columns: 1fr; gap: 3rem; }
  
  /* Reduce space between header and hero title */
  #hero { 
    padding: 20px 2rem 4rem; 
  }
  
  /* Footer nav vertical layout */
  .footer-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
}

@media (max-width: 768px) {
  .nav-inner  { padding: 1.2rem 1.5rem; }
  .page-section { padding: 4rem 1.5rem; }

  /* Consistent section gaps on mobile */
  .section-label { margin-bottom: 1.5rem; }
  .section-title { margin-bottom: 1.5rem; }

  #hero { min-height: 90vh; justify-content: center; padding: 100px 1.5rem 2.5rem; }
  .hero-title { margin-left: 0; max-width: 100%; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .hero-cta { gap: 1rem; }

  /* Work/Portfolio section spacing */
  .work-header { margin-bottom: 2.5rem; gap: 1rem; }
  .portfolio-grid { 
    grid-template-columns: 1fr; 
    gap: 1.25rem;
  }
  .portfolio-grid .project-card { grid-column: span 1; grid-row: span 1; }
  .project-info { padding: 1.25rem; }
  .tap-indicator   { display: block; }

  /* Remove hover effects on mobile */
  .project-card:hover { transform: none !important; box-shadow: none !important; }
  .project-card:hover .project-thumb-inner img { opacity: 1 !important; }

  /* About section spacing */
  .about-grid { gap: 2.5rem; }
  .about-text { margin-top: 2rem; margin-bottom: 1.5rem; }
  .about-sub { margin-bottom: 2rem; }
  .cta-section { gap: 0.75rem; }
  .portrait-badge { bottom: 1rem; left: 1rem; padding: 0.6rem 1rem; }

  /* Skills section spacing */
  .skills-grid-container { 
    grid-template-columns: 1fr; 
    gap: 1.5rem;
  }
  .skill-category { padding: 1.5rem; }
  .skill-heading { margin-bottom: 1rem; }
  .skill-list { gap: 0.6rem; }

  /* Contact section spacing */
  .contact-grid { gap: 2.5rem; }
  .contact-headline { margin-bottom: 2rem; }
  .contact-details { gap: 1rem; }
  .contact-dl { gap: 1rem; }
  .social-links { margin-top: 1.5rem; }

  /* Form spacing */
  .form-row { grid-template-columns: 1fr; gap: 1rem; }
  .contact-form { gap: 1rem; }

  /* Modal spacing on mobile */
  .modal-hero { margin-bottom: 2rem; }
  .modal-meta { gap: 1.5rem; margin-bottom: 1.5rem; }
  .modal-title { margin-bottom: 1rem; }
  .modal-body p { margin-bottom: 1rem; }
  .modal-tags { margin-top: 1.5rem; padding-bottom: 1.5rem; gap: 0.4rem; }
  .modal-actions { margin-top: 1.5rem; padding-top: 1.5rem; }

  /* Footer spacing */
  .site-footer { flex-direction: column; text-align: center; padding: 1.5rem; gap: 1rem; }
  .footer-nav  { justify-content: center; flex-direction: column; gap: 0.75rem; }
  .footer-top { flex-direction: column; gap: 0.75rem; align-items: center; }
  .footer-bottom { margin-top: 1rem; }
}

/* Extra small devices */
@media (max-width: 480px) {
  html, body { overflow-x: hidden; }
  .page-section { padding: 3rem 1rem; }
  
  #hero { padding: 90px 1rem 2rem; }
  
  .section-label { margin-bottom: 1rem; font-size: 0.65rem; }
  .section-title { margin-bottom: 1rem; }
  
  .work-header { margin-bottom: 2rem; }
  .portfolio-grid { gap: 1rem; }
  .project-info { padding: 1rem; }
  
  .about-grid { gap: 2rem; }
  .about-text { margin-top: 1.5rem; margin-bottom: 1rem; font-size: 1rem; }
  .about-sub { margin-bottom: 1.5rem; font-size: 0.8rem; }
  
  .skills-grid-container { gap: 1rem; }
  .skill-category { padding: 1.25rem; }
  
  .contact-grid { gap: 2rem; }
  .contact-headline { margin-bottom: 1.5rem; font-size: 1.1rem; }
  
  .modal-hero { margin-bottom: 1.5rem; }
  .modal-meta { gap: 1rem; margin-bottom: 1rem; flex-direction: column; }
  .modal-tags { margin-top: 1rem; padding-bottom: 1rem; }
  .modal-actions { margin-top: 1rem; padding-top: 1rem; }
}

/* ── 28. SCROLL TO TOP BUTTON */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--surface);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity var(--t-base), visibility var(--t-base), transform var(--t-base), background var(--t-base);
  z-index: 150;
  border-radius: 2px;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--gold);
  color: var(--bg);
}

/* Responsive: smaller on mobile, positioned to not block footer */
@media (max-width: 768px) {
  .scroll-top {
    width: 44px;
    height: 44px;
    font-size: 1rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* ── 29. LARGE SCREENS (1920px and up) ───────────────────────── */
@media (min-width: 1920px) {
  /* Keep sections full width for backgrounds, constrain inner content */
  .page-section { padding: 8rem 5rem; }
  #hero { padding: 80px 5rem 5rem; }

  /* Inner content containers with consistent max-width */
  .page-section > .section-label,
  .page-section > .section-title,
  .page-section > .work-header,
  .page-section > .portfolio-grid,
  .page-section > .about-grid,
  .page-section > .skills-grid-container,
  .page-section > .contact-grid,
  #hero > .hero-content {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
  }

  .nav-inner {
    padding: 1.5rem 5rem;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
  }

  .site-footer {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Marquee section - full width edge to edge */
  .marquee-section {
    max-width: none;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  /* Larger fonts for readability on big screens */
  body { font-size: 22px; }

  /* Hero section scaling */
  .hero-title {
    max-width: 55rem;
  }

  .hero-desc {
    max-width: 450px;
    font-size: 1.2rem;
  }

  /* Section typography */
  .section-title {
    font-size: 4rem;
  }

  .section-label {
    font-size: 0.9rem;
  }

  /* Project cards */
  .project-title {
    font-size: 1.4rem;
  }

  .project-desc {
    font-size: 1rem;
  }

  /* Header navigation */
  .nav-logo {
    font-size: 2rem;
  }

  .nav-links a {
    font-size: 1rem;
  }

  /* Footer */
  .footer-logo {
    font-size: 2.2rem;
  }

  .footer-nav a {
    font-size: 1rem;
  }

  .footer-copy {
    font-size: 1rem;
  }
}

/* ── 30. 4K DISPLAYS (2560px and up) ──────────────────────────── */
@media (min-width: 2560px) {
  /* Keep sections full width for backgrounds, constrain inner content */
  .page-section { padding: 10rem 6rem; }
  #hero { min-height: 100vh; padding: 60px 6rem 5rem; }

  /* Inner content containers with consistent max-width */
  .page-section > .section-label,
  .page-section > .section-title,
  .page-section > .work-header,
  .page-section > .portfolio-grid,
  .page-section > .about-grid,
  .page-section > .skills-grid-container,
  .page-section > .contact-grid,
  #hero > .hero-content {
    max-width: 2000px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Navigation alignment */
  .nav-inner {
    padding: 2rem 6rem;
    max-width: 2000px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Scale up typography for 4K readability - significantly larger */
  body { font-size: 26px; }

  /* Hero section - much bigger SVG */
  .hero-title {
    max-width: 65rem;
  }

  .hero-desc {
    max-width: 550px;
    font-size: 1.3rem;
  }

  /* Section typography - larger */
  .section-title {
    font-size: 5rem;
  }

  .section-label {
    font-size: 1.1rem;
  }

  /* Project cards - bigger text */
  .project-title {
    font-size: 1.6rem;
  }

  .project-desc {
    font-size: 1.15rem;
  }

  /* Header navigation - scaled up */
  .nav-logo {
    font-size: 2.5rem;
  }

  .nav-links a {
    font-size: 1.15rem;
  }

  /* Footer - scaled up */
  .footer-logo {
    font-size: 2.8rem;
  }

  .footer-nav a {
    font-size: 1.15rem;
  }

  .footer-copy {
    font-size: 1.1rem;
  }

  /* Modal text scaling */
  .modal-title {
    font-size: 2.2rem;
  }

  .modal-body {
    font-size: 1.1rem;
  }

  /* Ensure portfolio grid looks good on large screens */
  .portfolio-grid {
    gap: 2.5rem;
  }

  /* Modal sizing for 4K */
  .modal-dialog {
    max-width: 1100px;
  }

  /* Footer alignment */
  .site-footer {
    max-width: 2000px;
    margin-left: auto;
    margin-right: auto;
  }

  /* About section consistency */
  .about-grid {
    gap: 8rem;
  }

  /* Skills section consistency */
  .skills-grid-container {
    gap: 3rem;
  }

  /* Contact section consistency */
  .contact-grid {
    gap: 8rem;
  }
}

/* ── 31. REDUCED MOTION ─────────────────────────────────────── */
