/* =========================
   MATERIAL THEME (AUTO LIGHT/DARK)
========================= */

/* LIGHT THEME */
:root {

  /* Primary */
  --primary: #1C6586;
  --on-primary: #FFFFFF;
  --primary-container: #C4E7FF;
  --on-primary-container: #004C69;

  /* Secondary */
  --secondary: #4E616D;
  --on-secondary: #FFFFFF;
  --secondary-container: #D1E5F4;
  --on-secondary-container: #374955;

  /* Tertiary */
  --tertiary: #586421;
  --on-tertiary: #FFFFFF;

  /* Background / Surface */
  --background: #F6FAFE;
  --on-background: #181C1F;

  --surface: #F6FAFE;
  --on-surface: #181C1F;

  --surface-variant: #DCE3E9;
  --on-surface-variant: #41484D;

  --surface-container: #EAEEF3;
  --surface-container-high: #E5E8ED;

  /* Outline */
  --outline: #71787D;

  /* Shape */
  --radius: 24px;

  /* Motion */
 --transition: 0.18s cubic-bezier(0.2, 0, 0, 1);
  
}

/* DARK THEME */
@media (prefers-color-scheme: dark) {
  :root {

    --primary: #90CEF3;
    --on-primary: #00354A;
    --primary-container: #004C69;
    --on-primary-container: #C4E7FF;

    --secondary: #B5C9D7;
    --on-secondary: #20333E;
    --secondary-container: #374955;
    --on-secondary-container: #D1E5F4;

    --tertiary: #BFCE7E;
    --on-tertiary: #2B3400;

    --background: #0F1417;
    --on-background: #DFE3E7;

    --surface: #0F1417;
    --on-surface: #DFE3E7;

    --surface-variant: #41484D;
    --on-surface-variant: #C0C7CD;

    --surface-container: #1C2023;
    --surface-container-high: #262B2E;

    --outline: #8B9297;
  }
}

/* =========================
   BASE
========================= */

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--on-background);
}
* {
  transition:
    background-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition);
}

/* =========================
   TYPOGRAPHY (M3 SCALE)
========================= */

h1 {
  font-size: 2.75rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
}

h3 {
  font-size: 1.25rem;
  font-weight: 500;
}

p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--on-surface-variant);
}

.title {
  font-weight: 500;
  letter-spacing: 0.2px;
}


/* =========================
   SPACING SYSTEM
========================= */

section {
  margin-bottom: 3.5rem;
}

.card {
  padding: 1.75rem;
}

.card-content {
  gap: 0.6rem;
}

.chip-row {
  margin-top: 1rem;
}

.card-actions {
  margin-top: 1.5rem;
}


section h2 {
  margin-bottom: 1rem;
}

/* =========================
   LINKS
========================= */

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color var(--transition);
}

a:hover {
  color: var(--on-primary-container);
}

/* Underline animation */
a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

a:hover::after {
  transform: scaleX(1);
}

/* =========================
   TOP BAR
========================= */

.top-bar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: var(--secondary);
  color: var(--on-secondary);
  border-bottom: 1px solid var(--outline);
}

.top-bar nav a {
  margin-left: 1.5rem;
  color: var(--on-secondary);
  transition: color var(--transition);
}

.top-bar nav a:hover {
  color: var(--on-secondary-container);
}

.top-bar nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--on-secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

/* =========================
   LAYOUT
========================= */

.app {
  display: flex;
}

/* =========================
   NAV RAIL
========================= */

.nav-rail {
  width: 96px;
  background: var(--surface-variant);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  gap: 0.75rem;
}

.nav-item {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--on-surface-variant);
  position: relative;
  transition: all var(--transition);
}

.nav-item:hover {
  background: var(--surface-container-high);
  color: var(--on-surface);
}

.nav-item.active {
  color: var(--on-primary-container);
}

.nav-item.active::before {
  width: 56px;
  height: 32px;
  background: var(--primary);
  opacity: 0.9;
}

.btn {
  transition: all var(--transition);
}

.btn:active {
  transform: scale(0.98);
}


/* ICONS */

.material-symbols-rounded {
  font-size: 24px;
  line-height: 1;
}

/* LABEL */

.nav-item .label {
  font-size: 0.7rem;
  margin-top: 4px;
}

/* =========================
   CONTENT
========================= */
.content {
  flex: 1;
  padding: 2rem 3rem;

  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}


/* =========================
   HERO
========================= */

.hero {
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* =========================
   GRID
========================= */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
    margin-top: 1rem;

  /* KEY LINE */
  align-items: stretch;
}

/* =========================
   CARDS
========================= */

.card {
  display: flex;
  flex-direction: column;

  background: var(--surface-container);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 1.5rem;

  height: 100%; /* ensures full stretch */
  transition: var(--transition);

  position: relative;
  z-index: 0;
}

.card:hover {
  background: var(--surface-container-high);
   z-index: 1;
}
/* =========================
   ELEVATION
========================= */

.card {
  box-shadow:
    0 1px 2px rgba(0,0,0,0.08),
    0 2px 6px rgba(0,0,0,0.08);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 6px 18px rgba(0,0,0,0.18),
    0 2px 6px rgba(0,0,0,0.12);
}


.card-actions {
  margin-top: auto;

  display: flex;
  flex-direction: column;
  gap: 2rem;
}
/* Links row */
.action-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
}

/* =========================
   VIPM BADGE
========================= */

.vipm-badge img {
  height: 28px;
  border-radius: 8px;

  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

/* subtle hover lift */
.vipm-badge:hover img {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.vipm-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--on-surface-variant);
}

/* =========================
   STATE LAYERS
========================= */

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.card:hover::after {
  opacity: 0.03;
}


/* =========================
   CHIPS (FLOATING / M3 STYLE)
========================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  padding: 0.4rem 0.9rem;
  border-radius: 999px;

  background: var(--surface-container-high);
  color: var(--on-surface);

  border: 1px solid var(--outline);

  font-size: 0.85rem;
  font-weight: 500;

  cursor: default;

  /* FLOAT BASE */
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);

  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

/* Chips grouped together */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;

  margin-top: 0.75rem;
}

/* Space between chips and link */
.card-actions {
  margin-top: 1.25rem;
}


/* HOVER = LIFT */
.chip:hover {
  transform: translateY(-2px);

  box-shadow:
    0 4px 10px rgba(0,0,0,0.25),
    0 1px 3px rgba(0,0,0,0.2);
}

/* ACTIVE (pressed) */
.chip:active {
  transform: translateY(0);

  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* SELECTED CHIP */

.chip.selected {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border: none;

  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.chip.selected:hover {
  box-shadow:
    0 6px 14px rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.2);
}


/* =========================
   BUTTONS (M3 STYLE)
========================= */

.btn {
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

/* Filled */
.btn.filled {
  background: var(--primary);
  color: var(--on-primary);
}

/* Tonal */
.btn.tonal {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

/* Outlined */
.btn.outlined {
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--on-surface);
}

/* Text */
.btn.text {
  background: transparent;
  color: var(--primary);
}

/* Hover state layer */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::after {
  opacity: 0.08;
}

/* =========================
   DEMO ROW
========================= */

.demo-row {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* =========================
   COMPONENT BLOCK
========================= */

.component-block {
  background: var(--surface-container);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid var(--outline);
}

/* =========================
   PROJECT PAGE
========================= */

.project-hero {
  margin-bottom: 2rem;
}

.project-section {
  margin-top: 2.5rem;
}

/* =========================
   CTA ROW
========================= */

.cta-row {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

/* =========================
   CODE BLOCKS
========================= */

pre {
  background: var(--surface-container-high);
  padding: 1rem;
  border-radius: 16px;
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--outline);
}
/* =========================
   CREDENTIAL IMAGES
========================= */

/* Container (wrap your 3 images in this) */
.credential-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* Image styling */
.credential-image {
  width: 150px;
  height: 150px;
  object-fit: cover;

  border-radius: 20px;

  background: var(--surface-container);
  padding: 0.4rem;

  /* subtle elevation */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);

  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

/* Hover = lift */
.credential-image:hover {
  transform: translateY(-4px);

  box-shadow:
    0 8px 18px rgba(0,0,0,0.25),
    0 2px 6px rgba(0,0,0,0.2);

  border-color: var(--primary);
}

/* Optional: focus (keyboard accessibility) */
.credential-image:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.credential-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.credential-item span {
  font-size: 0.8rem;
  color: var(--on-surface-variant);
}
.credential-row {
  padding: 1rem;
  background: var(--surface-container);
  border-radius: var(--radius);
}

/* =========================
   CAROUSEL
========================= */

.carousel {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
}

/* Images */

.carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px);

  opacity: 0;
  transition: opacity var(--transition);
}

.carousel-image.active {
  opacity: 1;
}

/* Buttons */

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  background: rgba(0,0,0,0.4);
  color: white;

  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;

  cursor: pointer;

    backdrop-filter: blur(6px);
  transition: var(--transition);
}

.carousel-btn.prev {
  left: 8px;
}

.carousel-btn.next {
  right: 8px;
}

/* Dots */

.carousel-dots {
  position: absolute;
  bottom: 6px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.carousel-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}

.carousel-dots span.active {
  background: white;
}

.carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.25));
pointer-events: none; /* 🔥 allows clicks through */
}

.carousel-image.loaded {
  filter: blur(0);
}

.carousel-btn:hover {
  transform: translateY(-50%) scale(1.1);
  background: rgba(0,0,0,0.6);
}
/* =========================
   SECTION SPACING
========================= */

section {
  margin-bottom: 3rem;
}

/* =========================
   FADE / SLIDE IN
========================= */

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
