/* -----------------------------
   Base Styles & Variables
------------------------------*/
:root {
  /* Neutrals (dark theme) */
  --bg: #0a0b0d;
  --surface: #141619;
  --surface-2: #1b1e22;
  --text: #f4f5f7;
  --muted: #969ba5;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Accent — refined teal */
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --on-accent: #03100d;

  --cross-base: hsla(0, 0%, 100%, 0.16);

  /* Radius scale */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Soft, low-contrast shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.4);
}

/* Light theme override */
:root[data-theme='light'] {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f5f3;
  --text: #0b0d10;
  --muted: #5b6470;
  --border: rgba(15, 23, 32, 0.10);
  --border-strong: rgba(15, 23, 32, 0.18);

  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --on-accent: #ffffff;

  --cross-base: hsla(0, 0%, 0%, 0.22);

  --shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.08);
  --shadow: 0 8px 24px rgba(15, 23, 32, 0.10);
  --shadow-lg: 0 24px 60px rgba(15, 23, 32, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s ease, color 0.5s ease;
}

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

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

.section-padding {
  padding: 4rem 1.5rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* -----------------------------
   Header
------------------------------*/
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1101;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.accent-dot {
  color: var(--accent);
}

.site-header nav a {
  margin-left: 1.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  position: relative;
  transition: color 0.25s ease;
}

.site-header nav a:hover {
  color: var(--text);
}

.site-header nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.site-header nav a:hover::after {
  transform: scaleX(1);
}

/* -----------------------------
   Hero Section
------------------------------*/
.hero {
  position: relative;
  min-height: 90vh;
  padding: 6rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-title {
  font-size: clamp(2.6rem, 5vw + 1rem, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.1rem;
}

.accent {
  color: var(--accent);
  /* A single subtle glow — the only neon touch on the site, in the hero */
  text-shadow: 0 0 32px color-mix(in srgb, var(--accent) 45%, transparent);
}

.subtitle {
  max-width: 560px;
  color: var(--muted);
  margin-bottom: 3rem;
  font-size: 1.075rem;
  line-height: 1.6;
}

/* Radial background glow behind hero text */
.hero::before {
  content: "";
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60vmin;
  height: 24vmin;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.16;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
}

/* Bottom fade-out so grid/glow blend into next section */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 260px;
  background: linear-gradient(to bottom, transparent 20%, var(--bg) 100%);
  pointer-events: none;
  z-index: -1;
}

/* Canvas grid of crosses (rendered in script.js) */
.grid-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -3; /* behind radial glow */
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 800px;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  height: 170px;
  border: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: grayscale(0.35) brightness(0.7);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.card:hover .card-img {
  filter: grayscale(0) brightness(0.85);
  transform: scale(1.04);
}

.card-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}

/* -----------------------------
   Section headings + overline labels
------------------------------*/
h1, h2, h3, h4 {
  letter-spacing: -0.02em;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.section-label::before {
  content: attr(data-index) "  —  ";
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.about h2,
.portfolio h2,
.contact h2 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
}

.about p,
.contact p {
  max-width: 700px;
  color: var(--muted);
}

/* About section layout */
.about-content {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-top: 1.8rem;
}

.about-img {
  width: 250px;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.about-text {
  flex: 1;
  line-height: 1.8;
  font-size: 1rem;
  color: var(--muted);
}

/* Stack on small screens */
@media (max-width: 700px) {
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  .about-img {
    width: 250px;
    height: 300px;
  }
}

/* Project case studies */
.projects-heading {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 3rem;
}

.work-grid {
  /* --cols is set from the item count in script.js so rows stay balanced
     (e.g. 4 -> 2+2, 5 -> 3+2). The last row is centered by the flex layout. */
  --cols: 3;
  --work-gap: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--work-gap);
  margin-top: 1.4rem;
}

.work-item {
  flex: 0 1 100%;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), border-color 0.35s ease, box-shadow 0.35s ease;
}

@media (min-width: 600px) {
  .work-item {
    flex-basis: calc((100% - var(--work-gap)) / 2);
    max-width: calc((100% - var(--work-gap)) / 2);
  }
}

@media (min-width: 920px) {
  .work-item {
    flex-basis: calc((100% - (var(--cols) - 1) * var(--work-gap)) / var(--cols));
    max-width: calc((100% - (var(--cols) - 1) * var(--work-gap)) / var(--cols));
  }
}

.work-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.3) brightness(0.85);
  transition: filter 0.4s ease, transform 0.4s ease;
}

.work-item:hover .work-thumb img {
  filter: none;
  transform: scale(1.04);
}

.work-tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-caption {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.work-caption h3 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.work-caption p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  flex: 1;
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

.work-link::after {
  content: '\2197';
  font-size: 0.95rem;
  transition: transform 0.25s ease;
}

.work-item:hover .work-link::after {
  transform: translate(2px, -2px);
}

/* Editable placeholder cards */
.work-placeholder {
  border-style: dashed;
  border-color: var(--border-strong);
}

.work-placeholder:hover {
  box-shadow: none;
}

.work-thumb-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  background:
    repeating-linear-gradient(45deg, var(--surface-2) 0 10px, transparent 10px 20px),
    var(--surface);
}

.work-thumb-empty svg {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.work-placeholder .work-caption h3,
.work-placeholder .work-caption p {
  color: var(--muted);
}

/* -----------------------------
   Services Section
------------------------------*/
.services {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.services h2 {
  font-size: clamp(1.9rem, 2.5vw + 1rem, 2.4rem);
  margin-bottom: 0.75rem;
  text-align: center;
}

.services .section-label {
  display: block;
  text-align: center;
}

.services-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 3rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.services-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  justify-items: center;
}

.services-grid .service-card {
  width: 100%;
  max-width: 400px;
}

/* Mobile: 1 column */
@media (max-width: 767px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 2rem auto 0;
  }
}

/* Tablet: 2 columns (4 rows of 2 = perfect for 8 items) */
@media (min-width: 768px) and (max-width: 1199px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 850px;
    margin: 2rem auto 0;
    gap: 1.5rem;
  }
  
  .services-grid .service-card {
    max-width: 400px;
  }
}

/* Desktop: 4 columns (2 rows of 4 = perfect for 8 items) */
@media (min-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
    margin: 2rem auto 0;
    gap: 1.5rem;
  }
  
  .services-grid .service-card {
    max-width: 320px;
  }
}

.service-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 80px;
}

/* Accent ring that fades in/out smoothly on hover */
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.service-card:hover::after {
  opacity: 1;
}

.service-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 7px;
  transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.06);
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.service-card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.service-card p {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.85rem;
  margin: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .service-card {
    padding: 1.4rem 1.3rem;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .service-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
  }
}

/* Enhanced About & Contact Section */
.about-contact {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.about-contact .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  align-items: stretch;
}

/* About Section */
.about-section h2 {
  font-size: clamp(1.9rem, 2.5vw + 1rem, 2.4rem);
  margin-bottom: 2rem;
}

.about-content {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.about-img {
  width: 280px;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-img:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.about-text-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.about-text {
  line-height: 1.7;
  font-size: 1.05rem;
  color: var(--muted);
}

/* Experience Stats */
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.stat-item:hover .stat-number {
  color: var(--accent-strong);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* Tools Section Full Width */
.tools-section-full {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.tools-section-full h4 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.01em;
}

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

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.8rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tool-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.tool-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-icon svg {
  width: 100%;
  height: 100%;
}

.tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-name {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* Contact Card Inline (under bio) */
.contact-card-inline {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-card-inline:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* Experience Stats Full Width */
.experience-stats-full {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  justify-content: center;
}

.experience-stats-full .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
}

.experience-stats-full .stat-item:hover {
  transform: translateY(-2px);
}

.experience-stats-full .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.experience-stats-full .stat-item:hover .stat-number {
  color: var(--accent-strong);
}

.experience-stats-full .stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

/* Responsive for full-width stats */
@media (max-width: 768px) {
  .experience-stats-full {
    gap: 1.5rem;
    padding: 1.5rem 0;
  }
  
  .experience-stats-full .stat-number {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .experience-stats-full {
    flex-direction: column;
    gap: 1rem;
  }
  
  .experience-stats-full .stat-item {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
  
  .experience-stats-full .stat-number {
    font-size: 1.8rem;
  }
}

.contact-content {
  display: flex;
  align-items: stretch;
  gap: 1rem;
}

.contact-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
}

.contact-icon {
  width: 36px;
  height: 36px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.contact-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.contact-desc .arrow {
  color: var(--accent);
  font-weight: 600;
  margin-left: 0.5rem;
}

.contact-action {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
  align-self: stretch;
  min-width: 140px;
}

.contact-action:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
}

.arrow {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.contact-action:hover .arrow {
  transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  
  .about-img {
    width: 240px;
    height: 300px;
    align-self: center;
  }
  
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stat-item {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .tool-item {
    padding: 0.8rem 0.5rem;
  }
  
  .tool-name {
    font-size: 0.7rem;
  }
}


/* Responsive Design */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  
  .about-img {
    width: 240px;
    height: 300px;
    align-self: center;
  }
}

@media (max-width: 480px) {
  .stat-item {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}

/* Buttons */
.primary-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), background 0.25s ease;
}

.primary-btn:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  .site-header {
    padding: 0.8rem 1rem;
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .site-header nav a {
    margin-left: 0.8rem;
    font-size: 0.85rem;
  }
  
  .lang-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.8rem;
  }
  
  .theme-btn {
    font-size: 0.95rem;
    margin-left: 0.6rem;
  }
  
  .theme-btn svg {
    width: 0.95rem;
    height: 0.95rem;
  }
}

@media (max-width: 500px) {
  .site-header {
    padding: 0.6rem 0.8rem;
  }
  
  .logo {
    font-size: 0.9rem;
  }
  
  .site-header nav a {
    margin-left: 0.6rem;
    font-size: 0.8rem;
  }
  
  .lang-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.6rem;
  }
  
  .theme-btn {
    font-size: 0.85rem;
    margin-left: 0.5rem;
  }
  
  .theme-btn svg {
    width: 0.85rem;
    height: 0.85rem;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  
  /* Compact showreel overlay on phones */
  .video-overlay {
    padding: 0.85rem 0.9rem 0.95rem;
  }

  .video-overlay-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .video-text {
    max-width: 100%;
  }

  .video-title-line {
    font-size: 0.98rem;
  }

  .video-sub {
    font-size: 0.74rem;
  }

  .video-watch {
    padding: 0.45rem 0.85rem;
    font-size: 0.76rem;
  }

  .video-dots {
    margin-top: 0.7rem;
  }
}

@media (max-width: 380px) {
  .site-header nav a {
    margin-left: 0.4rem;
    font-size: 0.75rem;
  }
  
  .lang-btn {
    margin-left: 0.4rem;
  }
  
  .theme-btn {
    margin-left: 0.3rem;
  }
  
  /* Hide the longer subtitle on very small screens to keep the overlay clean */
  .video-sub {
    display: none;
  }

  .video-tag {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }
}

/* -----------------------------
   Modal Styles
------------------------------*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.25rem 2.5rem;
  width: min(90%, 460px);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(.4,0,.2,1), opacity 0.4s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Accent bar across the top of the modal */
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent) 70%, transparent);
}

.modal h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.modal-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, transform 0.25s;
}

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

.contact-form .form-group {
  margin-bottom: 1.1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline:none;
  border-color: var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

@keyframes crossColorWave {
  0%   { background: rgba(255,255,255,0.12); opacity: 0.25; }
  50%  { background: var(--accent);            opacity: 0.8;  }
  100% { background: rgba(255,255,255,0.12); opacity: 0.25; }
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-left: 1.5rem;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* theme button */
.theme-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  margin-left: 1rem;
  cursor: pointer;
  transition: transform 0.3s, color 0.25s;
}

.theme-btn:hover { transform: scale(1.12); color: var(--accent); }

.theme-btn svg{ width:1.1rem; height:1.1rem; fill:currentColor; vertical-align:middle;}

/* Tactile spin when toggling the theme */
.theme-btn.toggling{ animation: themeSpin 0.5s cubic-bezier(.4,0,.2,1); }

@keyframes themeSpin{
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}

/* -----------------------------
   Theme switch transition
   Circular reveal via the View Transitions API,
   with a gentle colour fade fallback elsewhere.
------------------------------*/
body{
  transition: background-color 0.5s ease, color 0.5s ease;
}

::view-transition-old(root),
::view-transition-new(root){
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root){ z-index: 1; }

::view-transition-new(root){
  z-index: 2;
  animation: themeReveal 0.5s cubic-bezier(.4,0,.2,1);
}

@keyframes themeReveal{
  from{ clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to  { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

/* Light theme component overrides */
:root[data-theme='light'] .card-label{
  color:#ffffff;
}

.video-wrapper{
  position: relative;
  width:100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9; /* 16:9 ratio maintained regardless of width */
  margin: 0 auto 2rem; /* centered */
  overflow:hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow:none;
}

.video-wrapper iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  border:0;
}

.video-wrapper::before,
.video-wrapper::after{
  content:"";
  position:absolute;
  left:0;right:0;
  height:80px;
  pointer-events:none;
  z-index:2;
}

.video-wrapper::before{ top:0; background:linear-gradient(to bottom, var(--bg) 0%, rgba(0,0,0,0) 100%); }
.video-wrapper::after{ bottom:0; background:linear-gradient(to top, var(--bg) 0%, rgba(0,0,0,0) 100%); }

.video-wrapper iframe {
  width:100%;
  height:100%;
  transform:none; /* no need to scale beyond wrapper */
}

/* Showreel overlay — kept minimal so it doesn't compete with the Projects below */
.video-overlay{
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  display:flex;
  flex-direction:column;
  padding:1.1rem 1.25rem 1.2rem;
  background:linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.1) 32%, rgba(0,0,0,0) 52%);
}

.video-overlay-top{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.video-counter{
  font-size:0.76rem;
  font-weight:600;
  letter-spacing:0.06em;
  color:rgba(255,255,255,0.7);
  font-variant-numeric:tabular-nums;
  text-shadow:0 1px 5px rgba(0,0,0,0.6);
}

.video-overlay-bottom{
  margin-top:auto;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
}

.video-text{ display:flex; flex-direction:column; gap:0.2rem; max-width:70%; }

.video-title-line{
  color:#fff;
  font-weight:600;
  font-size:1.05rem;
  letter-spacing:-0.01em;
  line-height:1.25;
  text-shadow:0 2px 14px rgba(0,0,0,0.6);
}

.video-sub{
  color:rgba(255,255,255,0.7);
  font-size:0.8rem;
  line-height:1.35;
  text-shadow:0 1px 8px rgba(0,0,0,0.55);
}

/* Minimal ghost link, not a filled button */
.video-watch{
  pointer-events:auto;
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  gap:0.35rem;
  color:rgba(255,255,255,0.85);
  font-size:0.8rem;
  font-weight:500;
  text-decoration:none;
  transition:color 0.25s ease;
}

.video-watch:hover{ color:var(--accent); }
.video-watch .ext{ font-size:0.9rem; transition:transform 0.25s ease; }
.video-watch:hover .ext{ transform:translate(2px,-2px); }

.video-dots{
  margin-top:0.9rem;
  align-self:center;
  display:flex;
  gap:0.45rem;
  pointer-events:auto;
}

.video-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  border:none;
  padding:0;
  cursor:pointer;
  background:rgba(255,255,255,0.35);
  transition:background 0.25s ease, width 0.25s ease;
}

.video-dot:hover{ background:rgba(255,255,255,0.65); }
.video-dot.active{ background:var(--accent); width:22px; border-radius:999px; }

.contact-form .primary-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.5rem;
  background:var(--accent);
  color:var(--on-accent);
  width:100%;
}

/* Arrow that nudges on hover */
.contact-form .primary-btn::after{
  content:'\2192';
  font-size:1.05rem;
  line-height:1;
  transition:transform 0.3s cubic-bezier(.4,0,.2,1);
}

.contact-form .primary-btn:hover{
  background:var(--accent-strong);
  transform:translateY(-2px);
}

.contact-form .primary-btn:hover::after{
  transform:translateX(4px);
}

.mail-icon{
  margin-right:0.5rem;
  width:1rem;
  height:1rem;
  display:inline-block;
}

.mail-icon svg{
  width:100%;
  height:100%;
  fill:currentColor;
  stroke:currentColor;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  fill:none;
}

.video-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:40px;
  height:40px;
  border:1px solid rgba(255,255,255,0.18);
  border-radius:50%;
  background:rgba(0,0,0,0.38);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  color:#fff;
  font-size:1.05rem;
  cursor:pointer;
  z-index:4;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  transition:opacity 0.3s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.video-wrapper:hover .video-nav{ opacity:1; }
.video-nav.prev{ left:14px; }
.video-nav.next{ right:14px; }
.video-nav:hover{
  background:var(--accent);
  color:var(--on-accent);
  border-color:transparent;
}
.video-nav.prev:hover{ transform:translateY(-50%) translateX(-2px); }
.video-nav.next:hover{ transform:translateY(-50%) translateX(2px); }

@media (hover:none){
  /* Always show touch-friendly arrows on touch devices */
  .video-nav{
    opacity:1;
    width:44px;
    height:44px;
  }
}

@supports not (aspect-ratio: 16 / 9) {
  .video-wrapper { padding-bottom: 56.25%; }
}

/* Full-bleed on small screens to ignore section padding */
@media (max-width: 1200px){
  .video-wrapper{
    width:100vw;
    margin-left:calc(50% - 50vw);
  }
}

/* -----------------------------
   Lazy Loading States
------------------------------*/
.lazy-bg {
  background-color: var(--surface);
  background-image: none !important;
  transition: opacity 0.4s ease;
}

.lazy-bg.loaded {
  opacity: 1;
}

.lazy-img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lazy-img.loaded {
  opacity: 1;
}

/* Skeleton loading for card images */
.lazy-bg:not(.loaded) {
  background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.1) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* -----------------------------
   Intro Screen
------------------------------*/
.intro-screen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--bg);
  z-index:2000;
  pointer-events:none;
  transition:transform 0.85s cubic-bezier(.76,0,.24,1), opacity 0.5s ease 0.3s;
}
.intro-screen.hidden{
  transform:translateY(-100%);
  opacity:0;
}

.intro-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1.1rem;
}

.intro-logo{
  display:flex;
  font-size:clamp(2.4rem, 9vw, 3.6rem);
  font-weight:800;
  letter-spacing:-0.025em;
  color:var(--text);
  line-height:1;
}
.intro-logo span{
  display:inline-block;
  opacity:0;
  transform:translateY(0.5em);
  animation:introLetter 0.6s cubic-bezier(.2,.7,.2,1) forwards;
}
.intro-logo span:nth-child(1){ animation-delay:0.04s; }
.intro-logo span:nth-child(2){ animation-delay:0.10s; }
.intro-logo span:nth-child(3){ animation-delay:0.16s; }
.intro-logo span:nth-child(4){ animation-delay:0.22s; }
.intro-logo span:nth-child(5){ animation-delay:0.28s; }
.intro-logo span:nth-child(6){ animation-delay:0.34s; }
.intro-logo .accent-dot{ color:var(--accent); animation-delay:0.42s; }

@keyframes introLetter{ to{ opacity:1; transform:none; } }

.intro-tagline{
  font-size:0.78rem;
  letter-spacing:0.2em;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:500;
  opacity:0;
  animation:introFade 0.6s ease 0.6s forwards;
}

.intro-bar{
  width:130px;
  height:2px;
  border-radius:2px;
  background:linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform:scaleX(0);
  transform-origin:left center;
  animation:introBar 0.9s cubic-bezier(.4,0,.2,1) 0.65s forwards;
}

@keyframes introFade{ to{ opacity:1; } }
@keyframes introBar{ to{ transform:scaleX(1); } }

/* -----------------------------
   Scroll-reveal choreography
------------------------------*/
.anim [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}

.anim [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* Hero headline word-by-word reveal */
.anim .hero-title .word-inner {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em);
  transition: opacity 0.6s ease, transform 0.75s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}

.anim .hero-title.words-in .word-inner {
  opacity: 1;
  transform: none;
}

.anim .subtitle {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1);
}

.anim .subtitle.in {
  opacity: 1;
  transform: none;
}

/* -----------------------------
   Reading progress bar
------------------------------*/
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  z-index: 1200;
  transform-origin: left center;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* -----------------------------
   Film grain overlay
------------------------------*/
.grain {
  position: fixed;
  inset: 0;
  z-index: 1150;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
}

:root[data-theme='light'] .grain {
  opacity: 0.045;
  mix-blend-mode: multiply;
}

/* -----------------------------
   Reduced Motion
   Respect users who prefer fewer animations.
------------------------------*/
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Stop the continuously looping decorative animations outright */
  .primary-btn,
  .contact-form .primary-btn,
  .lazy-bg:not(.loaded) {
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}