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

:root {
  --bg-primary:   #F5F0E8;   /* warm cream  */
  --bg-secondary: #EDE9DF;   /* darker cream */
  --bg-dark:      #0A0A0A;   /* jet black    */

  --text-primary:   #0A0A0A;
  --text-secondary: #3A3A3A;
  --text-muted:     #6B6B6B;
  --text-on-dark:   #F5F0E8;

  /* CMY — used only in the hero rule */
  --cmy-c: #00AEEF;
  --cmy-m: #EC008C;
  --cmy-y: #FFF200;

  --border-color: #0A0A0A;
  --border:       2px solid var(--border-color);
  --border-thick: 3px solid var(--border-color);
  --shadow:    5px 5px 0 var(--border-color);
  --shadow-lg: 9px 9px 0 var(--border-color);

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  --transition:      0.15s ease;
  --transition-slow: 0.25s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-primary);
}
html::-webkit-scrollbar       { width: 8px; }
html::-webkit-scrollbar-track { background: var(--bg-primary); }
html::-webkit-scrollbar-thumb { background: var(--border-color); }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a   { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: min(1400px, 90vw);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -50px;
  left: 8px;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 8px 16px;
  border: var(--border);
  z-index: 10000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: top var(--transition);
}
.skip-link:focus { top: 8px; }

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: var(--border-thick);
}
.navbar.scrolled { background: var(--bg-primary); }

.nav-container {
  max-width: min(1400px, 90vw);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bg-primary);
  background: var(--text-primary);
  padding: 0.25rem 0.6rem;
  letter-spacing: 0.04em;
  border: var(--border);
  transition: background var(--transition), color var(--transition);
}
.nav-logo:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.8rem;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.nav-link:hover,
.nav-link.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: var(--border);
}
.nav-social a {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  padding: 0.3rem;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.nav-social a:hover {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-primary);
}
.nav-social svg { width: 18px; height: 18px; }

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  background: none;
  border: var(--border);
  padding: 6px 8px;
}
.hamburger .bar {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition);
}
.hamburger.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== HERO ===== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(64px + 3rem) 0 4rem;
  background: var(--bg-primary);
}

.hero-content {
  max-width: min(1400px, 90vw);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr clamp(260px, 30vw, 400px);
  column-gap: clamp(2rem, 5vw, 5rem);
  row-gap: 0;
  align-items: start;
}

.hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-right {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  align-self: stretch;
}

.hero-photo-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border: var(--border-thick);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  filter: grayscale(100%) contrast(1.5) brightness(0.82);
}

.hero-photo-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
}

.hero-eyebrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.hero-label::after {
  content: '_';
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* The only color on the page */
.hero-rule {
  grid-column: 1 / -1;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--cmy-c)  33.33%,
    var(--cmy-m)  33.33% 66.66%,
    var(--cmy-y)  66.66%
  );
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 12vw, 10rem);
  font-weight: 700;
  line-height: 0.9;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  max-width: 520px;
  line-height: 1.7;
  border-left: 4px solid var(--text-primary);
  padding-left: 1rem;
}

.hero-stats {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: var(--border);
  padding: 0.3rem 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  border: var(--border);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}
.btn-primary:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow);
}

.btn svg { width: 16px; height: 16px; }

/* ===== SECTIONS ===== */
section { padding: clamp(4rem, 8vh, 6rem) 0; }

.section-header {
  text-align: left;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: var(--border-thick);
}

.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  color: inherit;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.section-line { display: none; }

/* ===== ABOUT — DARK ===== */
.about-section {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.about-section .section-header { border-bottom-color: #2a2a2a; }
.about-section .section-num    { color: #555; }

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "intro  intro"
    "roles  skills";
  gap: 2rem;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}
.about-text-section   { grid-area: intro; }
.about-roles-section  { grid-area: roles; }
.about-skills-section { grid-area: skills; }

.about-intro,
.about-skills {
  color: #b0b0b0;
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.about-roles {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.role-item {
  padding: 1rem 1.25rem;
  background: transparent;
  border: 2px solid #222;
  border-left: 4px solid #555;
  margin-bottom: -2px;
  transition: background var(--transition), border-color var(--transition);
}
.role-item:hover {
  background: rgba(245, 240, 232, 0.04);
  border-color: #555;
  border-left-color: var(--text-on-dark);
  position: relative;
  z-index: 1;
}
.role-item h3 {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.role-item p { font-size: 0.82rem; color: #666; }

.about-skills-section {
  display: flex;
  flex-direction: column;
}

.skill-row {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 2px solid #222;
  border-left: 4px solid #555;
  margin-bottom: -2px;
  transition: background var(--transition), border-color var(--transition);
}
.skill-row:hover {
  background: rgba(245, 240, 232, 0.04);
  border-left-color: var(--text-on-dark);
  position: relative;
  z-index: 1;
}

.skill-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.skill-values {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #b0b0b0;
  line-height: 1.5;
}

/* ===== PROJECTS — LIGHT ===== */
.projects-section { background: var(--bg-primary); }

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

.project-card {
  background: var(--bg-primary);
  border: var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-bottom: var(--border);
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(40%);
  transition: transform var(--transition-slow), filter var(--transition-slow);
}
.project-card:hover .project-image img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.project-card:hover .project-overlay { opacity: 1; }

.project-links { display: flex; gap: 0.5rem; }

.project-link {
  padding: 0.4rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--bg-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background var(--transition), color var(--transition);
}
.project-link:hover {
  background: transparent;
  color: var(--bg-primary);
}

.project-content { padding: 1.25rem; }

.project-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.project-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid rgba(10, 10, 10, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.projects-cta { text-align: left; margin-top: 2.5rem; }

/* ===== PROJECTS PAGE ===== */
.projects-header {
  padding: calc(64px + 3rem) 0 2.5rem;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-bottom: var(--border-thick);
  border-bottom-color: #222;
}
.projects-header .section-title  { color: var(--text-on-dark); }
.projects-header .section-num    { color: #555; }
.projects-header .section-header { border-bottom-color: #222; }

.projects-intro {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #666;
  max-width: 640px;
  margin: 0.75rem 0 0;
  line-height: 1.65;
}

.all-projects-section {
  background: var(--bg-primary);
  padding: clamp(3rem, 6vh, 5rem) 0 clamp(4rem, 8vh, 6rem);
}
.all-projects-section .projects-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card.detailed {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  align-items: stretch;
}
.project-card.detailed .project-image {
  height: 100%;
  min-height: 180px;
  border-bottom: none;
  border-right: var(--border);
}
.project-card.detailed .project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.back-to-home { margin-bottom: 1.5rem; }

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #666;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border: 2px solid #333;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all var(--transition);
}
.back-button:hover {
  color: var(--text-on-dark);
  border-color: #666;
}
.back-arrow { font-size: 1rem; }

/* ===== RESUME — SECONDARY ===== */
.resume-section {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.resume-section .section-header { border-bottom-color: rgba(0, 0, 0, 0.15); }

.resume-content { max-width: 880px; margin: 0 auto; }

.resume-preview {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.resume-item h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.resume-entry {
  margin-bottom: -2px;
  padding: 0.9rem 1.1rem;
  background: var(--bg-primary);
  border: var(--border);
  border-left: 4px solid var(--text-primary);
}
.resume-entry h4 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}
.resume-entry p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.skill-category {
  padding: 0.9rem 1.1rem;
  background: var(--bg-primary);
  border: var(--border);
  border-left: 4px solid var(--text-primary);
  margin-right: -2px;
  margin-bottom: -2px;
}
.skill-category h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.skill-category p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.resume-download { text-align: left; margin-top: 2rem; }

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: var(--border);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all var(--transition);
}
.download-button:hover {
  background: transparent;
  color: var(--text-primary);
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow);
}
.download-button svg { width: 16px; height: 16px; }

/* ===== CONTACT — DARK ===== */
.contact-section {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.contact-section .section-header { border-bottom-color: #2a2a2a; }
.contact-section .section-num    { color: #555; }

.contact-content { max-width: 720px; margin: 0 auto; text-align: left; }

.contact-info h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--text-on-dark);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.contact-info > p {
  font-family: var(--font-mono);
  color: #666;
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 2rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.contact-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid #222;
  margin-bottom: -2px;
  transition: background var(--transition), border-color var(--transition);
}
.contact-item:hover {
  background: rgba(245, 240, 232, 0.04);
  border-color: #555;
  position: relative;
  z-index: 1;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  min-width: 56px;
}
.contact-value {
  font-family: var(--font-mono);
  color: var(--text-on-dark);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.contact-value:hover { color: #ffffff; }

.contact-social { margin-top: 1.5rem; display: flex; gap: 0.5rem; }
.contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2px solid #333;
  color: #666;
  transition: all var(--transition);
}
.contact-social a:hover {
  color: var(--text-on-dark);
  border-color: #666;
  background: rgba(245, 240, 232, 0.06);
}
.contact-social svg { width: 18px; height: 18px; }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.back-to-top.visible { opacity: 1; visibility: visible; }

.back-to-top-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: var(--border);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.back-to-top-button:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-primary);
  border-top: var(--border-thick);
  padding: 2rem 0;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-content p {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.footer-branding { display: flex; align-items: center; gap: 0.35rem; }
.footer-branding p {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.footer-links { display: flex; gap: 0; }
.footer-links a {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.footer-links a:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.fgh-logo {
  height: 16px;
  width: auto;
  display: inline;
  vertical-align: middle;
  filter: brightness(0);
}
.about-section .fgh-logo {
  filter: brightness(0) invert(1);
  opacity: 0.5;
}
.fgh-logo-footer {
  height: 13px;
  width: auto;
  display: inline;
  vertical-align: middle;
  filter: brightness(0);
  opacity: 0.3;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 10, 0.88);
}
.modal-content {
  background: var(--bg-primary);
  margin: 3vh auto;
  border: var(--border-thick);
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 1000px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.15s ease-out;
}
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  z-index: 1;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  border: var(--border);
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--text-primary); color: var(--bg-primary); }

.modal-header { padding: 1.5rem 1.5rem 1rem; border-bottom: var(--border); }
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.modal-image { width: 100%; height: 300px; overflow: hidden; border: var(--border); }
.modal-image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(20%); }

.modal-body { padding: 1.25rem 1.5rem 1.5rem; }
.modal-body p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.modal-details h3,
.modal-tech h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-left: 3px solid var(--text-primary);
  padding-left: 0.5rem;
}
.modal-details ul { list-style: none; margin-bottom: 1.25rem; }
.modal-details li {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  padding-left: 1.5rem;
  position: relative;
}
.modal-details li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--text-primary);
  font-weight: 700;
}
#modalTechTags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.modal-links {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: var(--border);
}

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

/* ===== ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero-right { display: none; }

  .hero-section {
    position: relative;
  }
  .hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/portfolioPicture.jpg') center top / cover no-repeat;
    filter: grayscale(100%) contrast(1.8) brightness(0.5);
    z-index: 0;
  }
  .hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.08) 3px,
        rgba(0, 0, 0, 0.08) 4px
      ),
      linear-gradient(rgba(245, 240, 232, 0.48), rgba(245, 240, 232, 0.48));
    z-index: 1;
    pointer-events: none;
  }
  .hero-content { position: relative; z-index: 2; }

  .about-content {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "roles"
      "skills";
  }
  .skills-grid { grid-template-columns: 1fr; }
  .project-card.detailed { grid-template-columns: 1fr; }
  .project-card.detailed .project-image {
    height: 200px;
    border-right: none;
    border-bottom: var(--border);
  }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1.5rem clamp(1.5rem, 4vw, 2.5rem);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    border-top: var(--border-thick);
    gap: 0;
  }
  .nav-menu.active { transform: translateX(0); }
  .nav-social {
    margin-left: 0; padding-left: 0;
    border-left: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: var(--border);
    gap: 0.75rem;
  }
  .hamburger { display: flex; }
  .nav-link {
    font-size: 0.85rem;
    padding: 0.85rem 0;
    width: 100%;
    border: none;
    border-top: 1px solid rgba(0,0,0,0.06);
  }
  .nav-link:hover { padding-left: 0.5rem; }

  .hero-section { padding-top: calc(64px + 2rem); }
  .hero-title { font-size: clamp(3.5rem, 18vw, 5.5rem); }
  .hero-eyebrow { flex-direction: column; gap: 0.2rem; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 300px; }
  .btn { justify-content: center; }

  .about-content { gap: 1.5rem; }
  .projects-section .projects-grid { grid-template-columns: 1fr; }
  section { padding: 3.5rem 0; }

  .footer-content { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .container     { padding: 0 clamp(1rem, 4vw, 1.5rem); }
  .nav-container { padding: 0 clamp(1rem, 4vw, 1.5rem); }
  .hero-title    { font-size: clamp(3rem, 16vw, 4.5rem); }
  .section-title { font-size: clamp(2rem, 9vw, 3rem); }
  .skills-grid   { grid-template-columns: 1fr; }
}

/* ===== ACCESSIBILITY ===== */
*:focus-visible {
  outline: 3px solid var(--text-primary);
  outline-offset: 2px;
}
@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;
  }
}
@media (prefers-contrast: high) {
  :root {
    --bg-primary: #FFFFFF;
    --text-primary: #000000;
    --border-color: #000000;
  }
}
