@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Josefin+Sans:wght@100;200;300;400&display=swap');

:root {
  --paper: #FDFBF1;
  --charcoal: #252627;
  --grey: #6B6B6B;
  --gold: #EED8AA;
  --gold-dark: #C4A96B;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Josefin Sans', 'Century Gothic', sans-serif;
}

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

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

body {
  font-family: var(--font-sans);
  font-weight: 300;
  background-color: var(--paper);
  color: var(--charcoal);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Paper texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
}

main {
  width: 100%;
}

/* ── Landing ── */
#landing {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.landing-content {
  max-width: 1200px;
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

#blobCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background-color: transparent;
  transition: opacity 0.8s ease;
}

#blobCanvas.loaded {
  opacity: 1;
}

#landing::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--paper));
  z-index: 2;
  pointer-events: none;
}

/* ── Navigation ── */
.top-nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 5;
}

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

.nav-left .logo-link {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--charcoal);
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--charcoal);
  text-decoration: none;
  transition: all 0.3s ease;
}

.nav-left .logo-link:hover {
  background: var(--charcoal);
  color: var(--paper);
}

.nav-right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  position: relative;
  z-index: 5;
}

.nav-icon {
  color: var(--charcoal);
  font-size: 1.3rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(37, 38, 39, 0.3);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav-icon:hover {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--paper);
}

.nav-icon i {
  transition: all 0.3s ease;
}

.construction-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(37, 38, 39, 0.25);
  color: var(--charcoal);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  overflow: hidden;
  width: 2.25rem;
  height: 2.25rem;
  transition: all 0.3s ease;
}

.construction-notice:hover {
  width: 13rem;
  border-color: var(--charcoal);
}

.construction-notice i {
  color: var(--gold-dark);
  flex-shrink: 0;
  font-size: 1rem;
}

.construction-notice span {
  white-space: nowrap;
  opacity: 0;
  width: 0;
  max-width: 0;
  transition: all 0.3s ease;
}

.construction-notice:hover span {
  opacity: 1;
  width: auto;
  max-width: 200px;
  padding-left: 0.4rem;
}

/* ── CV button in nav ── */
.nav-cv-btn {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--charcoal);
  border: 1px solid var(--charcoal);
  padding: 0 0.75rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.25s ease;
}

.nav-cv-btn:hover {
  background: var(--charcoal);
  color: var(--paper);
}

[data-theme="dark"] .nav-cv-btn {
  border-color: rgba(232, 228, 216, 0.4);
}

/* ── Hero tags (AI badge etc.) ── */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.hero-tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--grey);
  border: 1px solid rgba(37, 38, 39, 0.2);
  padding: 0.28rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-tag i {
  font-size: 0.8rem;
  color: var(--gold-dark);
}

[data-theme="dark"] .hero-tag {
  border-color: rgba(232, 228, 216, 0.2);
}

/* ── Job bubble ── */
.job-bubble {
  margin-bottom: 2.5rem;
  z-index: 5;
  position: relative;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--charcoal);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease;
  animation: float 4s ease-in-out infinite;
  will-change: transform;
  backface-visibility: hidden;
}

.job-bubble:hover {
  background: var(--charcoal);
  color: var(--paper);
  transform: translateY(-4px);
}

.link-underline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Profile ── */
.profile-container {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  border: 1px solid rgba(37, 38, 39, 0.18);
  padding: 2rem;
  margin-top: 2rem;
  z-index: 2;
  position: relative;
  background: rgba(253, 251, 241, 0.7);
}

.profile-picture {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border: 1px solid rgba(37, 38, 39, 0.3);
  filter: grayscale(0.25) sepia(0.1);
}

.info {
  max-width: 600px;
}

.desktop-title {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.mobile-title {
  display: none;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.highlight {
  font-style: italic;
  color: var(--charcoal);
}

.desktop-title .highlight,
.mobile-title .highlight {
  font-style: normal;
  font-weight: 700;
}

.location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 1rem;
}

.location .highlight {
  color: var(--gold-dark);
  font-style: normal;
}

.info p {
  font-size: 1rem;
  color: var(--charcoal);
  line-height: 1.8;
}

/* ── Sections common ── */
section:not(#landing) {
  position: relative;
  isolation: isolate;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

section:not(#landing) h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.75rem;
  display: block;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--charcoal);
  opacity: 0.7;
  max-width: 620px;
  margin-bottom: 3rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* thin ruled line under section heading */
section:not(#landing) h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--gold-dark);
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}

/* ── Technologies ── */
#technologies {
  text-align: left;
  padding: 5rem 2rem;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  width: 100%;
  max-width: 1100px;
  border: 1px solid rgba(37, 38, 39, 0.12);
  overflow: hidden;
}

.tech-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.25rem;
  background: transparent;
  border-right: 1px solid rgba(37, 38, 39, 0.12);
  border-bottom: 1px solid rgba(37, 38, 39, 0.12);
  transition: all 0.25s ease;
  min-height: 90px;
  position: relative;
}

.tech-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  transform-origin: bottom;
}

.tech-card:hover {
  background: rgba(238, 216, 170, 0.07);
}

.tech-card:hover::before {
  transform: scaleY(1);
}

.tech-icon {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 38, 39, 0.15);
}

.tech-icon i {
  font-size: 1.3rem;
  color: var(--charcoal);
  transition: all 0.25s ease;
}

.tech-icon .svg-icon {
  width: 1.3rem;
  height: 1.3rem;
  filter: brightness(0);
  opacity: 0.75;
  transition: all 0.25s ease;
}

.tech-card:hover .tech-icon {
  border-color: var(--charcoal);
}

/* remove per-tech background colors — use monochrome */
.tech-card:nth-child(1) .tech-icon,
.tech-card:nth-child(2) .tech-icon,
.tech-card:nth-child(3) .tech-icon,
.tech-card:nth-child(4) .tech-icon,
.tech-card:nth-child(5) .tech-icon,
.tech-card:nth-child(6) .tech-icon,
.tech-card:nth-child(7) .tech-icon,
.tech-card:nth-child(8) .tech-icon,
.tech-card:nth-child(9) .tech-icon {
  background: transparent;
  border-color: rgba(37, 38, 39, 0.18);
}

.tech-card:nth-child(4) .tech-icon i {
  color: var(--charcoal);
}

.tech-content {
  flex-grow: 1;
  min-width: 0;
}

.tech-content h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--charcoal);
  margin-bottom: 0.15rem;
}

.tech-content p {
  font-size: 0.78rem;
  color: var(--grey);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

/* ── Work Experience ── */
#work {
  padding: 5rem 2rem;
}

.work-timeline {
  padding: 0.5rem 0;
  max-width: 800px;
}

.work-item {
  display: flex;
  margin-bottom: 3rem;
  position: relative;
}

.work-item:last-child {
  margin-bottom: 0;
}

.work-item:before {
  content: '';
  position: absolute;
  left: 200px;
  top: 0;
  bottom: -3rem;
  width: 1px;
  background: rgba(37, 38, 39, 0.15);
}

.work-item:last-child:before {
  bottom: 0;
}

.work-date {
  width: 200px;
  flex-shrink: 0;
  padding-right: 3rem;
  text-align: right;
}

.work-date .date {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.work-date .duration {
  font-size: 0.82rem;
  color: var(--grey);
  letter-spacing: 0.04em;
}

.work-content {
  padding-left: 3rem;
  position: relative;
}

.work-content:before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 9px;
  height: 9px;
  background: var(--gold);
  border: 1px solid var(--charcoal);
}

.work-content h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.3rem;
}

.work-content .company {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 1rem;
}

.work-content ul {
  padding-left: 1rem;
}

.work-content li {
  font-size: 0.95rem;
  color: var(--charcoal);
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

/* ── Projects ── */
#projects {
  padding: 5rem 2rem;
}

/* ════════════ Bento / mosaic projects grid ════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 210px;
  grid-auto-flow: dense;
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
}

/* The card itself fills its grid cell */
.project-card {
  grid-column: span 1;
  grid-row: span 1;
}
.project-card .project-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.project-card .project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Tile sizes ─────────────────────────────────────── */
/* Big feature tile: 2×2 */
.tile-lg { grid-column: span 2; grid-row: span 2; }
.tile-lg .project-image,
.tile-lg .project-image--ph { height: 52%; }
.tile-lg .project-content { flex: 1; justify-content: flex-start; padding: 1.25rem; overflow: hidden; }
.tile-lg .project-content h3 { font-size: 1.55rem; margin-bottom: 0.4rem; }
.tile-lg .project-content p { font-size: 0.92rem; line-height: 1.55; -webkit-line-clamp: 3; }

/* Wide tile: 2×1, image/placeholder on the left, text on the right */
.tile-wide { grid-column: span 2; grid-row: span 1; }
.tile-wide .project-link { flex-direction: row; }
.tile-wide .project-image,
.tile-wide .project-image--ph { width: 42%; height: 100%; flex-shrink: 0; border-bottom: none; border-right: 1px solid rgba(37, 38, 39, 0.08); }
.tile-wide .project-content { border-top: none; padding: 1rem 1.1rem; }
.tile-wide .project-content h3 { font-size: 1.2rem; }
.tile-wide .project-content p { font-size: 0.85rem; -webkit-line-clamp: 2; }

/* Base small tile: 1×1, no image, compact */
.project-card:not(.tile-lg):not(.tile-wide) .project-image,
.project-card:not(.tile-lg):not(.tile-wide) .project-image--ph { display: none; }
.project-card:not(.tile-lg):not(.tile-wide) .project-content {
  border-top: none;
  justify-content: flex-start;
  /* extra top padding clears the absolute index numeral */
  padding: 2.4rem 1.1rem 1.1rem;
  overflow: hidden;
}
.project-card:not(.tile-lg):not(.tile-wide) .project-content h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.project-card:not(.tile-lg):not(.tile-wide) .project-content p {
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 0.6rem;
  -webkit-line-clamp: 2;
}
.project-card:not(.tile-lg):not(.tile-wide) .card-badge { margin-bottom: 0.5rem; }

/* Clamp long descriptions so tiles stay tidy */
.project-content p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tags pinned to the bottom of every tile */
.project-content .tech-tags { margin-top: auto; }

/* ── Grouped sections ("who it's for") ────────────────── */
.project-group { width: 100%; max-width: 1100px; margin: 0 auto; }
.project-group + .project-group { margin-top: 3.5rem; }

.project-group-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(37, 38, 39, 0.12);
}

.project-group-head .grp-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  white-space: nowrap;
}

.project-group-head h3 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1;
}

.project-group-head .grp-count {
  margin-left: auto;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--grey);
  white-space: nowrap;
}

.project-group .projects-grid { margin: 0; }

/* ── Type badge on each card ───────────────────────────── */
.card-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  border: 1px solid rgba(196, 169, 107, 0.5);
  padding: 0.16rem 0.5rem;
  margin-bottom: 0.6rem;
  border-radius: 999px;
}
.tile-lg .card-badge { font-size: 0.68rem; }

[data-theme="dark"] .project-group-head h3 { color: #E8E4D8; }
[data-theme="dark"] .project-group-head { border-color: rgba(232, 228, 216, 0.15); }

/* ── Editorial index numerals ─────────────────────────── */
.card-index {
  position: absolute;
  top: 0.6rem;
  left: 0.85rem;
  z-index: 3;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  opacity: 0.9;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(253, 251, 241, 0.7);
}
.tile-lg .card-index { font-size: 1rem; }

/* Title shifts to gold on hover */
.project-content h3 { transition: color 0.25s ease; }
.project-card:hover .project-content h3 { color: var(--gold-dark); }

/* ── Decorative closing "ghost" tile ──────────────────── */
.tile-ghost .project-link {
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(37, 38, 39, 0.25);
  color: var(--grey);
  text-align: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
}
.tile-ghost { border: none !important; box-shadow: none !important; }
.tile-ghost:hover { transform: none; box-shadow: none; }
.tile-ghost .project-link:hover { border-color: var(--charcoal); color: var(--charcoal); }
.tile-ghost i { font-size: 1.6rem; color: rgba(37, 38, 39, 0.3); }
.tile-ghost span {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Staggered reveal ─────────────────────────────────── */
.projects-grid .project-card {
  opacity: 0;
  transform: translateY(18px);
}
.projects-grid .project-card.tile-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--tile-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .projects-grid .project-card { opacity: 1; transform: none; transition: none; }
}

/* Dark theme tweaks for the bento */
[data-theme="dark"] .card-index { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .tile-wide .project-image,
[data-theme="dark"] .tile-wide .project-image--ph { border-right-color: rgba(232, 228, 216, 0.12); }

@media (max-width: 880px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .tile-lg { grid-column: span 2; grid-row: span 2; }
  .tile-wide { grid-column: span 2; grid-row: span 1; }
  .project-card { grid-column: span 1; }
}

@media (max-width: 560px) {
  .projects-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .project-card,
  .tile-lg,
  .tile-wide { grid-column: span 1; grid-row: span 1; }
  .tile-wide .project-link { flex-direction: column; }
  .tile-wide .project-image,
  .tile-wide .project-image--ph { width: 100%; height: 160px; border-right: none; }
  .project-card:not(.tile-lg):not(.tile-wide) .project-content,
  .tile-lg .project-content { min-height: 150px; }
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(37, 38, 39, 0.15);
  background: transparent;
  overflow: hidden;
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: var(--charcoal);
  box-shadow: 4px 4px 0 var(--gold);
  transform: translate(-2px, -2px);
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-github-link {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  color: var(--charcoal);
  background: rgba(253, 251, 241, 0.9);
  font-size: 1.1rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(37, 38, 39, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.card-github-link:hover {
  background: var(--charcoal);
  color: var(--paper);
}

/* Lock variant for personal / non-public projects */
.card-lock {
  cursor: default;
  color: var(--grey);
}
.card-lock:hover {
  background: rgba(253, 251, 241, 0.9);
  color: var(--charcoal);
}

.project-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

/* Placeholder image for cards without a screenshot yet */
.project-image--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg,
      rgba(238, 216, 170, 0.10) 0 14px,
      transparent 14px 28px);
  border-bottom: 1px solid rgba(37, 38, 39, 0.08);
}

.project-image--ph i {
  font-size: 2.2rem;
  color: rgba(37, 38, 39, 0.25);
  transition: color 0.3s ease;
}

.tile-lg .project-image--ph i { font-size: 3.2rem; }
.tile-wide .project-image--ph i { font-size: 2.6rem; }

.project-card:hover .project-image--ph i { color: var(--gold-dark); }

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96);
  transition: all 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.03);
  filter: saturate(1.05);
}

.project-content {
  padding: 1.25rem 1.25rem 1.5rem;
  border-top: 1px solid rgba(37, 38, 39, 0.1);
}

.project-content h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.project-content p {
  font-size: 0.95rem;
  color: var(--charcoal);
  opacity: 0.65;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-tag {
  background: transparent;
  border: 1px solid rgba(37, 38, 39, 0.2);
  color: var(--charcoal);
  padding: 0.25rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.project-card:hover .tech-tag {
  border-color: rgba(37, 38, 39, 0.4);
}

/* Ghost card */
.ghost-card {
  border: 1px dashed rgba(37, 38, 39, 0.2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  box-shadow: none !important;
  transform: none !important;
}

.ghost-content {
  text-align: center;
  color: var(--grey);
}

.ghost-content i {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: block;
  color: rgba(37, 38, 39, 0.25);
  transform-origin: 70% 70%;
  transition: all 0.3s ease;
}

.ghost-content p {
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0.05em;
}

.ghost-card:hover {
  border-color: rgba(37, 38, 39, 0.4) !important;
  background: rgba(238, 216, 170, 0.05) !important;
}

.ghost-card:hover .ghost-content i {
  color: var(--gold-dark);
  animation: hammer-swing 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.ghost-card:hover .ghost-content p {
  color: var(--charcoal);
}

/* ── Contact ── */
#contact {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  border: 1px solid rgba(37, 38, 39, 0.15);
  padding: 3rem;
}

.contact-info h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 1.25rem;
}

.contact-info h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--gold-dark);
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}

.contact-description {
  font-size: 1rem;
  color: var(--charcoal);
  opacity: 0.7;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

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

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.contact-item i {
  font-size: 1.1rem;
  color: var(--gold-dark);
}

.contact-item a {
  color: var(--charcoal);
  transition: opacity 0.2s ease;
}

.contact-item a:hover {
  opacity: 0.6;
}

.contact-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.social-link {
  color: var(--charcoal);
  font-size: 1.2rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(37, 38, 39, 0.25);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.social-link:hover {
  background: var(--charcoal);
  color: var(--paper);
  border-color: var(--charcoal);
}

/* Contact form */
.contact-form {
  padding: 0;
}

.form-group {
  margin-bottom: 1.75rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}

input, textarea {
  width: 100%;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(37, 38, 39, 0.25);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--charcoal);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-bottom-color: #c0392b;
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.form-group input.valid,
.form-group textarea.valid {
  border-bottom-color: var(--gold-dark);
}

.char-counter {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--grey);
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.char-counter.invalid { color: #c0392b; }
.char-counter.valid   { color: var(--gold-dark); }
.char-counter.warning { color: #8a6a1a; }

.char-counter #charCount {
  font-weight: 400;
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--charcoal);
  color: var(--paper);
  border: 1px solid var(--charcoal);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
  height: 3.5rem;
  transition: all 0.3s ease;
}

.submit-btn:not(:disabled):hover:not(.success):not(.sending) {
  background: var(--paper);
  color: var(--charcoal);
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 var(--gold);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-content,
.success-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-content {
  background: var(--gold-dark);
  color: var(--paper);
  transform: translateY(100%);
  gap: 0.75rem;
}

.submit-btn.success .button-content {
  transform: translateY(-100%);
}

.submit-btn.success .success-content {
  transform: translateY(0);
}

.submit-btn.sending {
  background: var(--charcoal);
  opacity: 0.75;
  pointer-events: none;
}

.submit-btn.sending::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(253, 251, 241, 0.3);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.submit-btn.success {
  background: var(--gold-dark);
}

.checkmark {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: drawCheck 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* ── Project detail styles ── */
.project-header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.project-title-section {
  flex-grow: 1;
}

.github-link {
  color: var(--charcoal);
  font-size: 1.3rem;
  padding: 0.6rem;
  border: 1px solid rgba(37, 38, 39, 0.25);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.github-link:hover {
  background: var(--charcoal);
  color: var(--paper);
}

/* ── Game Dev section ── */
#gamedev {
  padding: 5rem 2rem;
}

.gamedev-layout {
  max-width: 780px;
}

.gamedev-title-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.gamedev-name {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--charcoal);
  letter-spacing: 0.02em;
}

.gamedev-desc {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--charcoal);
  opacity: 0.82;
  margin-bottom: 2rem;
  max-width: 680px;
}

.gamedev-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-left: 0;
  border-left: 2px solid var(--gold);
  padding-left: 1.25rem;
}

.gamedev-feat {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  font-size: 0.9rem;
}

.feat-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  min-width: 7rem;
  flex-shrink: 0;
}

.feat-val {
  color: var(--charcoal);
  line-height: 1.5;
}

.gamedev-countdown {
  margin-bottom: 1.75rem;
}

/* ── Competitions section ── */
#competitions {
  padding: 5rem 2rem;
}

.comp-featured {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  border: 1px solid rgba(37, 38, 39, 0.15);
  padding: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
}

[data-theme="dark"] .comp-featured {
  border-color: rgba(232, 228, 216, 0.12);
}

.comp-place-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border: 1px solid var(--gold-dark);
  color: var(--gold-dark);
  text-align: center;
}

.comp-place-num {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}

.comp-place-ord {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comp-featured-body {
  flex: 1;
  min-width: 0;
}

.comp-meta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.comp-event {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.comp-type-tag {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  border: 1px solid rgba(37, 38, 39, 0.2);
  padding: 0.15rem 0.5rem;
}

[data-theme="dark"] .comp-type-tag {
  border-color: rgba(232, 228, 216, 0.2);
}

.comp-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 1rem;
}

.comp-desc {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--charcoal);
  opacity: 0.78;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.comp-also {
  margin-top: 1rem;
}

.comp-also .section-eyebrow {
  margin-bottom: 1rem;
  display: block;
}

.comp-minor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comp-minor-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--charcoal);
  opacity: 0.7;
}

.comp-minor-item i {
  color: var(--gold-dark);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --paper: #1A1A18;
  --charcoal: #E8E4D8;
  --grey: #8A8A7A;
}

[data-theme="dark"] body::after {
  opacity: 0.015;
}

[data-theme="dark"] .profile-container {
  background: rgba(26, 26, 24, 0.75);
}

[data-theme="dark"] .profile-picture {
  filter: grayscale(0.3) sepia(0.05) brightness(0.82);
}

[data-theme="dark"] .project-image img {
  filter: grayscale(0.25) sepia(0.05) brightness(0.8);
}

[data-theme="dark"] .top-nav {
  background: rgba(26, 26, 24, 0.96);
  border-top-color: rgba(232, 228, 216, 0.1);
}

[data-theme="dark"] #landing::after {
  background: linear-gradient(to bottom, transparent, #1A1A18);
}

[data-theme="dark"] section:not(#landing) {
  background-color: #1A1A18;
}

[data-theme="dark"] #contact {
  background-color: #1A1A18;
}

[data-theme="dark"] .placeholder-sketch svg {
  opacity: 0.55;
}

/* ── Dark mode border + element fixes ── */
[data-theme="dark"] .nav-icon,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .construction-notice {
  border-color: rgba(232, 228, 216, 0.25);
}

[data-theme="dark"] .profile-container {
  border-color: rgba(232, 228, 216, 0.15);
}

[data-theme="dark"] .profile-picture {
  border-color: rgba(232, 228, 216, 0.22);
}

[data-theme="dark"] .tech-grid {
  border-color: rgba(232, 228, 216, 0.12);
}

[data-theme="dark"] .tech-card {
  border-right-color: rgba(232, 228, 216, 0.12);
  border-bottom-color: rgba(232, 228, 216, 0.12);
}

[data-theme="dark"] .tech-icon {
  border-color: rgba(232, 228, 216, 0.18);
}

[data-theme="dark"] .tech-icon .svg-icon {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

[data-theme="dark"] .work-item::before {
  background: rgba(232, 228, 216, 0.15);
}

[data-theme="dark"] .project-card {
  border-color: rgba(232, 228, 216, 0.15);
}

[data-theme="dark"] .project-content {
  border-top-color: rgba(232, 228, 216, 0.1);
}

[data-theme="dark"] .card-github-link {
  background: rgba(26, 26, 24, 0.88);
  border-color: rgba(232, 228, 216, 0.25);
}

[data-theme="dark"] .tech-tag {
  border-color: rgba(232, 228, 216, 0.2);
}

[data-theme="dark"] .wip-tag {
  border-color: rgba(232, 228, 216, 0.22);
}

[data-theme="dark"] .ghost-card {
  border-color: rgba(232, 228, 216, 0.2) !important;
}

[data-theme="dark"] .contact-container {
  border-color: rgba(232, 228, 216, 0.12);
}

[data-theme="dark"] .social-link {
  border-color: rgba(232, 228, 216, 0.22);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea {
  border-bottom-color: rgba(232, 228, 216, 0.22);
}

[data-theme="dark"] .section-sketch-wrap {
  opacity: 0.28;
}

/* ── Theme toggle button ── */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(37, 38, 39, 0.3);
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--charcoal);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.theme-toggle:hover {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--paper);
}

/* ── Section sketch decoration ── */
.section-sketch-wrap {
  position: absolute;
  top: 3rem;
  right: -1rem;
  width: 380px;
  height: 320px;
  z-index: -1;
  color: var(--charcoal);
  opacity: 0.22;
  pointer-events: none;
}

.hero-sketch {
  width: 100%;
  height: 100%;
}

.hero-sketch .sk {
  stroke: currentColor;
  fill: none;
  stroke-width: 1;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
}

.hero-sketch .dot {
  stroke: none;
  stroke-dasharray: unset;
  stroke-dashoffset: unset;
  opacity: 0;
  animation: sketch-dot 0.1s ease forwards;
}

/* Draw-in only fires when .sketch-visible is added via IntersectionObserver */
.sketch-visible .sk1  { animation: sketch-draw 0.9s ease forwards 0.05s; }
.sketch-visible .sk2  { animation: sketch-draw 0.6s ease forwards 0.8s; }
.sketch-visible .sk3  { animation: sketch-draw 0.25s ease forwards 1.4s; }
.sketch-visible .sk4  { animation: sketch-draw 0.7s ease forwards 1.0s; }
.sketch-visible .sk5  { animation: sketch-draw 0.5s ease forwards 1.6s; }
.sketch-visible .sk6  { animation: sketch-draw 0.8s ease forwards 1.9s; }
.sketch-visible .sk7  { animation: sketch-draw 0.5s ease forwards 2.6s; }
.sketch-visible .sk8  { animation: sketch-draw 0.5s ease forwards 3.0s; }
.sketch-visible .sk9  { animation: sketch-draw 0.5s ease forwards 3.3s; }
.sketch-visible .sk10 { animation: sketch-draw 0.3s ease forwards 3.7s; }
.sketch-visible .sk11 { animation: sketch-draw 0.4s ease forwards 3.5s; }
.sketch-visible .sk12 { animation: sketch-draw 0.3s ease forwards 3.8s; }
.sketch-visible .sk13 { animation: sketch-draw 0.7s ease forwards 4.0s; }
.sketch-visible .sk14 { animation: sketch-draw 0.3s ease forwards 4.6s; }
.sketch-visible .sk15 { animation: sketch-draw 0.4s ease forwards 4.8s; }
.sketch-visible .sk16 { animation: sketch-draw 0.4s ease forwards 1.7s; }
.sketch-visible .sk17 { animation: sketch-draw 0.4s ease forwards 5.0s; }
.sketch-visible .dot  { animation: sketch-dot 0.2s ease forwards 5.1s; }

/* Left-side variant — shift far enough left that the sketch sits in the gutter */
.section-sketch-wrap--left {
  right: auto;
  left: calc(-380px + 5rem);
}

@keyframes sketch-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes sketch-dot {
  to { opacity: 1; }
}

/* Hide sketch decoration on small screens */
@media (max-width: 900px) {
  .section-sketch-wrap {
    display: none;
  }
}

/* ── Countdown card ── */
.countdown-wrap {
  margin: 0.75rem 0 1rem;
}

.countdown-units {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.5rem;
}

.cd-unit span {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1;
}

.cd-unit small {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
}

.cd-sep {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-dark);
  margin-bottom: 0.8rem;
  align-self: flex-start;
  padding-top: 0.1rem;
}

/* ── Award / WIP tags on project title ── */
.award-tag {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  border: 1px solid var(--gold-dark);
  padding: 0.15rem 0.45rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.wip-tag {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  border: 1px solid rgba(37, 38, 39, 0.25);
  padding: 0.15rem 0.45rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

/* ── Placeholder sketch card image ── */
.project-image--placeholder {
  background: rgba(37, 38, 39, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .project-image--placeholder {
  background: rgba(232, 228, 216, 0.04);
}

.placeholder-sketch {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--charcoal);
  opacity: 0.4;
}

.placeholder-sketch svg {
  width: 100%;
  height: auto;
}

/* ── Animations ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
  40%, 60% { transform: translate3d(2px, 0, 0); }
}

@keyframes hammer-swing {
  0%, 100% { transform: rotate(0deg); }
  30%  { transform: rotate(25deg); }
  70%  { transform: rotate(-5deg); }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .contact-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 2rem;
  }
}

@media (max-width: 768px) {
  .landing-content {
    padding: 1rem;
    padding-bottom: 5rem;
  }

  .profile-container {
    flex-direction: column;
    text-align: left;
    padding: 1.5rem;
    margin-top: 1rem;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: block;
  }

  .profile-picture {
    width: 100%;
    height: 220px;
  }

  .tech-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .work-timeline {
    padding: 0;
  }

  .work-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .work-item:before {
    display: none;
  }

  .work-date {
    width: 100%;
    text-align: left;
    padding: 0;
  }

  .work-content {
    padding-left: 0;
  }

  .work-content:before {
    display: none;
  }

  #contact {
    padding: 3rem 1rem;
  }

  .contact-container {
    padding: 1.5rem;
    gap: 2rem;
  }

  .contact-info h2 {
    font-size: 2.2rem;
  }

  .top-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(253, 251, 241, 0.96);
    backdrop-filter: blur(8px);
    padding: 0.75rem;
    margin: 0;
    z-index: 100;
    border-top: 1px solid rgba(37, 38, 39, 0.15);
  }

  .nav-left {
    display: none;
  }

  .nav-right {
    width: 100%;
    justify-content: space-evenly;
    gap: 0;
  }

  section:not(#landing) {
    padding-bottom: 6rem;
  }
}

@media (max-width: 480px) {
  .contact-item {
    font-size: 0.85rem;
  }

  .contact-item a {
    word-break: break-all;
  }
}

@media (min-width: 1400px) {
  .landing-content {
    max-width: 1400px;
  }

  #contact {
    padding: 6rem 2rem;
    max-width: 1400px;
  }

  .contact-info h2 {
    font-size: 3rem;
  }
}
