/* =========================================================
   CUSTOM PROPERTIES (animatable)
   Registers --border-angle as an angle so we can animate it
   inside conic-gradient. Without @property, the browser treats
   custom props as plain strings and won't interpolate them.
   ========================================================= */
@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* =========================================================
   DESIGN TOKENS
   Change these to iterate on the whole vibe.
   ========================================================= */
:root {
  /* palette */
  --bg-0: #08080d;
  --bg-1: #12121a;
  --bg-2: #1c1c26;
  --border: rgba(255, 255, 255, 0.08);
  --text-0: #f2f2f5;
  --text-1: #a8a8b3;
  --text-2: #6d6d78;
  --accent: #ff1744;
  --accent-soft: rgba(255, 23, 68, 0.15);

  /* type */
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;

  /* layout */
  --max-w: 1120px;
  --gutter: 24px;

  /* motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* =========================================================
   NAVBAR
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(8, 8, 13, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* --- Logo: animated underline that slides in from left --- */
.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-0);
  letter-spacing: -0.02em;
  position: relative;
  padding: 4px 0;
}

.nav-logo::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav-logo:hover::after {
  transform: scaleX(1);
}

/* --- Nav links: underline expanding from center + lift --- */
.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 6px 2px;
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.3s var(--ease);
  box-shadow: 0 0 8px var(--accent);
}

.nav-links a:hover {
  color: var(--text-0);
  transform: translateY(-1px);
}

.nav-links a:hover::after {
  width: 100%;
}

/* --- Nav socials: circular pill background + glow on hover --- */
.nav-socials {
  display: flex;
  gap: 6px;
}

.nav-socials a {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  font-size: 16px;
  border-radius: 50%;
  transition: color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
  overflow: hidden;
}

.nav-socials a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid transparent;
  transform: scale(0.5);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease),
    border-color 0.3s var(--ease);
}

.nav-socials a i {
  position: relative;
  z-index: 1;
}

.nav-socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px -6px var(--accent);
}

.nav-socials a:hover::before {
  transform: scale(1);
  opacity: 1;
  border-color: rgba(255, 23, 68, 0.3);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gutter);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img,
.hero-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at center,
      rgba(8, 8, 13, 0.4) 0%,
      rgba(8, 8, 13, 0.85) 70%,
      var(--bg-0) 100%
    );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  text-align: center;
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  min-height: 3.2em;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--text-1);
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--text-1);
  font-size: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease);
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent);
  background-image: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  background-size: 250% 100%;
  background-position: -50% 0;
  background-repeat: no-repeat;
  color: var(--bg-0);
  transition: background-position 0.6s var(--ease),
    background-color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.btn-primary:hover {
  background-color: #ff5273;
  background-position: 150% 0;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px var(--accent),
    0 0 0 3px rgba(255, 23, 68, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-0);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-1);
}

/* =========================================================
   SECTION SCAFFOLDING
   ========================================================= */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 120px var(--gutter);
}

.section-header {
  margin-bottom: 48px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}

.section-title {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* =========================================================
   FEATURED PROJECT (big card)
   ========================================================= */
.featured-project {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  transition: border-color 0.3s var(--ease);
}

.featured-project:hover {
  border-color: rgba(255, 23, 68, 0.3);
}

.featured-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-2);
  width: 100%;
}

.featured-media .cs-carousel {
  position: absolute;
  inset: 0;
}

.featured-media .cs-carousel-track {
  cursor: pointer;
}

.featured-media .cs-carousel-track img,
.featured-media .cs-carousel-track video {
  transition: transform 0.5s var(--ease);
}

.featured-media:hover .cs-carousel-track img,
.featured-media:hover .cs-carousel-track video {
  transform: scale(1.03);
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}

.featured-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.featured-desc {
  color: var(--text-1);
  margin-bottom: 20px;
  font-size: 15px;
}

.featured-links {
  margin-top: 24px;
}

/* =========================================================
   TAGS
   ========================================================= */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 12px;
  font-weight: 500;
}

/* =========================================================
   PROJECT GRID
   ========================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  display: block;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
  width: 100%;
  position: relative;
  isolation: isolate;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

/* --- Traveling neon outline on hover ---
   Uses conic-gradient rotated via --border-angle, then masks out
   everything except a 2px "ring" so it looks like a stroke
   traveling around the card border. */
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--border-angle),
    transparent 0deg,
    transparent 260deg,
    var(--accent) 310deg,
    #ff8ba0 330deg,
    var(--accent) 350deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 23, 68, 0.3);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7),
    0 0 24px -4px rgba(255, 23, 68, 0.2);
}

.project-card:hover::before {
  opacity: 1;
  animation: card-outline 2.5s linear infinite;
}

@keyframes card-outline {
  to {
    --border-angle: 360deg;
  }
}

.project-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.project-card:hover .project-thumb img {
  transform: scale(1.08);
}

/* --- Arrow icon: appears from top-right on hover --- */
.project-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transform: translate(8px, -8px) scale(0.8);
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
  box-shadow: 0 8px 20px -6px var(--accent);
  pointer-events: none;
}

.project-card:hover .project-arrow {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

.project-card:hover .project-arrow i {
  animation: arrowNudge 0.6s var(--ease) 0.15s;
}

@keyframes arrowNudge {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* --- Card body --- */
.project-body {
  padding: 22px 22px 24px;
}

.project-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--text-0);
  transition: color 0.3s var(--ease);
}

.project-card:hover .project-name {
  color: var(--accent);
}

.project-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 240px 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}

/* --- Circular photo with rotating neon outline (same trick as project cards) --- */
.about-photo {
  position: relative;
  isolation: isolate;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.about-photo:hover img {
  transform: scale(1.05);
}

/* rotating outline: conic-gradient masked to a 2px ring around the circle */
.about-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--border-angle),
    transparent 0deg,
    transparent 260deg,
    var(--accent) 310deg,
    #ff8ba0 330deg,
    var(--accent) 350deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.about-photo:hover::before {
  opacity: 1;
  animation: card-outline 2.5s linear infinite;
}

.about-text p {
  font-size: 17px;
  color: var(--text-1);
  margin-bottom: 20px;
}

.about-side {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.about-side h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-2);
  margin-bottom: 4px;
  margin-top: 20px;
  font-weight: 600;
}

.about-side h4:first-child {
  margin-top: 0;
}

.about-side p {
  font-size: 15px;
  color: var(--text-0);
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact-content {
  text-align: center;
}

.contact-lead {
  font-size: 18px;
  color: var(--text-1);
  margin-bottom: 24px;
}

.contact-email {
  display: inline-block;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-0);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  margin-bottom: 40px;
  transition: color 0.2s var(--ease);
}

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

.contact-socials {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.contact-socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  font-size: 15px;
  transition: color 0.2s var(--ease);
}

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

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px var(--gutter);
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}

/* =========================================================
   PERSONAL STATEMENT
   ========================================================= */
.statement {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px var(--gutter) 40px;
  text-align: center;
}

.statement-lead {
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.5;
  font-weight: 500;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

/* =========================================================
   EXPERIENCE (zigzag timeline)
   Central vertical line, cards alternate sides.
   Each card has a glowing dot on the line + a subtle notch
   pointing toward it.
   ========================================================= */
.experience-timeline {
  position: relative;
  padding: 20px 0;
}

/* the vertical line down the center */
.experience-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-50%);
  z-index: 0;
}

.experience-item {
  position: relative;
  width: calc(50% - 40px);
  margin-bottom: 48px;
  z-index: 1;
}

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

/* odd items go to the RIGHT of the line */
.experience-item:nth-child(odd) {
  margin-left: calc(50% + 40px);
}

/* even items go to the LEFT of the line, text right-aligned */
.experience-item:nth-child(even) {
  margin-right: calc(50% + 40px);
  text-align: right;
}

/* --- the glowing dot on the timeline --- */
.experience-item::after {
  content: "";
  position: absolute;
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-0), 0 0 16px rgba(255, 23, 68, 0.7),
    0 0 32px rgba(255, 23, 68, 0.35);
  z-index: 2;
}

.experience-item:nth-child(odd)::after {
  left: -47px; /* 40px gap + 7px (half dot) to land on the center line */
}

.experience-item:nth-child(even)::after {
  right: -47px;
}

/* --- the card itself --- */
.experience-card {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.experience-item:hover .experience-card {
  border-color: rgba(255, 23, 68, 0.25);
}

.experience-item:hover::after {
  box-shadow: 0 0 0 4px var(--bg-0), 0 0 20px rgba(255, 23, 68, 0.9),
    0 0 40px rgba(255, 23, 68, 0.5);
}

/* --- the notch pointing from card toward the line ---
   Rotated square with only 2 borders visible, gives a
   clean triangular arrow tip that matches the card. */
.experience-card::before {
  content: "";
  position: absolute;
  top: 32px;
  width: 14px;
  height: 14px;
  background: var(--bg-1);
  transform: rotate(45deg);
}

.experience-item:nth-child(odd) .experience-card::before {
  left: -8px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.experience-item:nth-child(even) .experience-card::before {
  right: -8px;
  border-right: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.experience-date {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.experience-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--text-0);
}

.experience-company {
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 12px;
}

.experience-desc {
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* =========================================================
   TESTIMONY
   ========================================================= */
.testimony-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.testimony-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  min-width: 180px;
}

.testimony-person img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.testimony-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-0);
}

.testimony-role {
  font-size: 13px;
  color: var(--text-2);
}

.testimony-quote {
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.5;
  color: var(--text-0);
  font-style: italic;
  position: relative;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
}

.testimony-quote i {
  color: var(--accent);
  font-size: 20px;
  margin-right: 8px;
  opacity: 0.6;
}

/* =========================================================
   RESUME BUTTON (nav + contact)
   Shares the shine + glow visual language with .btn-primary.
   ========================================================= */
.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  background-color: var(--accent);
  background-image: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  background-size: 250% 100%;
  background-position: -50% 0;
  background-repeat: no-repeat;
  color: var(--bg-0);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-position 0.6s var(--ease),
    background-color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.resume-btn i {
  transition: transform 0.35s var(--ease);
}

.resume-btn:hover {
  background-color: #ff5273;
  background-position: 150% 0;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px var(--accent),
    0 0 0 3px rgba(255, 23, 68, 0.15);
}

.resume-btn:hover i {
  transform: translateY(3px);
}

.resume-btn:active {
  transform: translateY(0);
}

/* Size modifiers */
.resume-btn--sm {
  padding: 8px 16px;
  font-size: 13px;
  margin-left: 12px;
}

.resume-btn--lg {
  padding: 14px 28px;
  font-size: 15px;
}

.contact-resume {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

/* =========================================================
   MODAL (case study)
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.is-open {
  display: flex;
  animation: modalFadeIn 0.25s var(--ease);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.modal-window {
  position: relative;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 23, 68, 0.1);
  animation: modalPop 0.35s var(--ease);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(8, 8, 13, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-0);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.modal-close:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  transform: rotate(90deg);
}

.modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --- Case study content --- */
.cs-media {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--bg-2);
}

/* Carousel container fills the cs-media aspect box */
.cs-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.cs-carousel-track {
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 0.2s var(--ease);
}

.cs-carousel-track img,
.cs-carousel-track video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Arrows: hidden by default, appear on carousel hover */
.cs-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-0);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s var(--ease), background 0.2s var(--ease),
    transform 0.2s var(--ease);
  z-index: 2;
}

.cs-carousel:hover .cs-carousel-arrow {
  opacity: 1;
}

.cs-carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
}

.cs-carousel-prev {
  left: 14px;
}
.cs-carousel-prev:hover {
  transform: translateY(-50%) translateX(-2px);
}

.cs-carousel-next {
  right: 14px;
}
.cs-carousel-next:hover {
  transform: translateY(-50%) translateX(2px);
}

/* Dots */
.cs-carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}

.cs-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: width 0.3s var(--ease), background 0.25s var(--ease);
}

.cs-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.cs-carousel-dot.is-active {
  background: var(--accent);
  width: 22px;
}

/* Single-media state: hide navigation entirely */
.cs-carousel[data-single="true"] .cs-carousel-arrow,
.cs-carousel[data-single="true"] .cs-carousel-dots {
  display: none;
}

.cs-content {
  padding: 32px 40px 40px;
}

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.cs-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.cs-section {
  margin-bottom: 28px;
}

.cs-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.cs-heading-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.15em;
  font-family: "Inter", monospace;
}

.cs-section p {
  color: var(--text-1);
  font-size: 15px;
  line-height: 1.7;
}

.cs-section p + p {
  margin-top: 14px;
}

/* --- Tabs (only rendered when project has 2+ sections) --- */
.cs-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cs-tabs::-webkit-scrollbar { display: none; }

.cs-tab {
  position: relative;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}

.cs-tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}

.cs-tab:hover {
  color: var(--text-0);
}

.cs-tab.is-active {
  color: var(--text-0);
  font-weight: 600;
}

.cs-tab.is-active::after {
  transform: scaleX(1);
}

/* --- Panels (only active is visible) --- */
.cs-panel {
  display: none;
}

.cs-panel.is-active {
  display: block;
  animation: csPanelIn 0.25s var(--ease);
}

@keyframes csPanelIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Description panel: brighter, slightly larger, feels like the pitch --- */
.cs-description p {
  color: var(--text-0);
  font-size: 17px;
  line-height: 1.65;
}

.cs-description p + p {
  margin-top: 16px;
}

/* --- Team panel: grid of name+role cards --- */
.cs-team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.cs-team-member {
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.cs-team-member:hover {
  border-color: rgba(255, 23, 68, 0.25);
  transform: translateY(-2px);
}

.cs-team-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 4px;
}

.cs-team-role {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
}

.cs-tags {
  margin: 32px 0 24px;
}

.cs-actions {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: flex-end;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .nav {
    padding: 16px 20px;
  }

  .nav-links {
    display: none; /* Mobile menu could be added later */
  }

  .featured-project {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    justify-items: center;
  }

  .about-text,
  .about-side {
    justify-self: stretch;
  }

  .testimony-card {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 24px;
  }

  /* --- timeline collapses to single column with line on the left --- */
  .experience-timeline::before {
    left: 12px;
    transform: none;
  }

  .experience-item,
  .experience-item:nth-child(odd),
  .experience-item:nth-child(even) {
    width: auto;
    margin-left: 44px;
    margin-right: 0;
    text-align: left;
  }

  .experience-item::after,
  .experience-item:nth-child(odd)::after,
  .experience-item:nth-child(even)::after {
    left: -39px;
    right: auto;
  }

  .experience-card::before,
  .experience-item:nth-child(odd) .experience-card::before,
  .experience-item:nth-child(even) .experience-card::before {
    left: -8px;
    right: auto;
    border: none;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .cs-content {
    padding: 24px 20px 32px;
  }

  .statement {
    padding: 60px var(--gutter) 20px;
  }

  .section {
    padding: 80px var(--gutter);
  }
}

@media (max-width: 500px) {
  .nav-socials {
    gap: 12px;
  }

  .resume-btn--sm span {
    display: none;
  }

  .resume-btn--sm {
    padding: 8px 10px;
    margin-left: 6px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .btn {
    justify-content: center;
  }
}

#word {
  display: inline-block;
}

#word::after {
  content: "|";
  display: inline-block;
  margin-left: 0.05em;
  color: var(--text-0);
  font-weight: 400;
  animation: cursor-blink 1s steps(2, start) infinite;
}

@keyframes cursor-blink {
  to {
    visibility: hidden;
  }
}
img[src$="papercut-cover.png"] {
  object-fit: contain;
  background: var(--bg-2);
}
