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

:root {
  --bg: #2e0f1b;
  --bg-alt: #4d1f2d;
  --panel: rgba(73, 30, 43, 0.92);
  --text: #f8edf0;
  --text-light: #d7b8bf;
  --text-muted: #ab808c;
  --accent: #8c2f39;
  --accent-light: #b76e79;
  --accent-dark: #d24a59;
  --border: #6e3748;
  --nav-bg: rgba(46, 15, 27, 0.94);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-dark);
}

button {
  font: inherit;
}

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  padding: 6px;
  border-radius: 12px;
  background: rgba(248, 237, 240, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
}

.nav-link:hover {
  color: var(--text);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

section {
  padding: 96px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-alt);
  overflow: hidden;
  max-width: none;
  padding: 0 24px;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, color-mix(in srgb, var(--accent) 8%, transparent) 0%, transparent 50%);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-alt) 30%, transparent));
  z-index: 2;
}

.hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.8;
  filter: saturate(0.9);
  z-index: 0;
  background-image: url("./images/hero-bg.jpg");
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  width: min(820px, 100%);
  padding: 110px 24px 48px;
}

.hero-avatar-wrap {
  width: 132px;
  margin: 0 auto 24px;
}

.hero-avatar {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #f5e6d3;
  margin-bottom: 14px;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.8),
    0 2px 8px rgba(0,0,0,0.5),
    0 4px 20px rgba(0,0,0,0.3);
}

.hero-content h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: 1.1rem;
  color: #f5eadd;
  max-width: 34ch;
  margin: 0 auto 28px;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.8),
    0 2px 8px rgba(0,0,0,0.5);
}

.hero-skill-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-skill-strip span,
.text-link,
.filter-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.hero-skill-strip span {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.74rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--panel);
  border-color: var(--accent-light);
  color: var(--text);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

.section-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#core-support {
  padding-top: 72px;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.support-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.support-card h3,
.case-study-copy h3,
.project-dialog-content h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  line-height: 1.12;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 4px rgba(0, 0, 0, 0.2);
}

#projectDialogTitle {
  color: #ff3a3a;
}

.support-card p,
.case-study-copy p,
.about-text p,
.about-credentials li,
.contact-item,
.project-dialog-content p,
.project-dialog-content li {
  color: var(--text-light);
}

.case-study {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 56px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.case-study:last-child {
  margin-bottom: 0;
}

.portfolio-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
}

.concept-pill-group,
.concept-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.concept-pill,
.portfolio-select {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.8rem;
}

.concept-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  background: rgba(46, 15, 27, 0.7);
}

.concept-pill-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.portfolio-select {
  min-width: 180px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.case-study-reverse .case-study-media {
  order: 2;
}

.case-study-reverse .case-study-copy {
  order: 1;
}

.case-study-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  cursor: pointer;
}

.case-study-media {
  min-height: 420px;
}

.case-study-stack {
  display: grid;
  grid-template-rows: 1.2fr 0.8fr;
  gap: 16px;
}

.case-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 10px;
}

.case-study-copy ul,
.project-dialog-content ul {
  padding-left: 18px;
  margin: 16px 0 0;
}

.case-study-copy {
  padding-right: 8px;
}

.text-link {
  margin-top: 18px;
  color: var(--accent);
  background: var(--panel);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.text-link:hover {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.filters {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filters-secondary {
  margin-bottom: 0;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent-light);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 2;
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(46, 15, 27, 0.85);
  color: var(--text);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--accent-light);
}

.gallery-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px 14px;
  background: linear-gradient(to top, rgba(23, 20, 18, 0.7), rgba(23, 20, 18, 0));
  color: #fff;
  z-index: 1;
}

.gallery-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.15;
}

#contact {
  background: var(--bg-alt);
  max-width: none;
}

#about {
  background: var(--bg);
  max-width: none;
}

#about {
  padding-top: 72px;
}

#about .section-header,
#contact .section-header {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  max-width: 1000px;
  margin: 0 auto;
}

.about-text p {
  margin-bottom: 20px;
}

.about-credentials h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.about-credentials ul {
  list-style: none;
  margin-bottom: 28px;
}

.about-credentials li {
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.about-credentials li::before {
  content: "\2014";
  position: absolute;
  left: 0;
  color: var(--accent-light);
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  max-width: 940px;
  margin: 0 auto;
}

.software-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.software-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.06));
}

.software-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
}

.contact-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
}

.contact-item span:first-child {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.contact-item a {
  color: var(--text);
  font-size: 1.1rem;
}

.contact-item a:hover {
  color: var(--accent-light);
}
}

#contact {
  padding-top: 72px;
  padding-bottom: 72px;
}

footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 0 auto 12px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(248, 237, 240, 0.96);
}

.footer-credit {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.7;
}
.footer-credit a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 200;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
  margin-top: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.lightbox-close {
  top: 24px;
  right: 28px;
  font-size: 2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  padding: 12px;
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

.project-dialog {
  width: min(900px, calc(100% - 24px));
  border: none;
  padding: 0;
  background: transparent;
  margin: auto;
}

.project-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.project-dialog-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--accent-light);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  max-height: 85vh;
  overflow-y: auto;
}

.project-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 1px solid var(--accent-light);
  background: var(--panel);
  color: var(--text-light);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  z-index: 2;
}

.project-dialog-close:hover {
  background: var(--accent);
  color: var(--bg);
}

.project-dialog-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.project-dialog-gallery img {
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.project-dialog-gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 920px) {
  .support-grid,
  .about-grid,
  .software-grid,
  .case-study {
    grid-template-columns: 1fr;
  }

  .case-study-reverse .case-study-media,
  .case-study-reverse .case-study-copy {
    order: initial;
  }

  .case-study-media {
    min-height: 320px;
  }

  .project-dialog-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    height: 60px;
  }

  .logo {
    gap: 10px;
    font-size: 1rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: rgba(250, 248, 245, 0.98);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    display: block;
    padding: 14px 24px;
  }

  #hero {
    min-height: auto;
  }

  .hero-content {
    padding: 104px 12px 48px;
  }

  .hero-avatar-wrap,
  .hero-avatar {
    width: 104px;
    height: 104px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .lightbox-nav {
    font-size: 2.2rem;
  }

}
