/* Semantic + project color variables */
:root {
  --bg-gradient: radial-gradient(circle at top, #2a3140 0, #05060a 55%, #000000 100%);
  --accent: #6ea9ff;
  --accent-soft: rgba(110, 169, 255, 0.35);
  --text-main: #f5f5f7;
  --text-muted: #9e9ea7;
  --glass-bg: rgba(10, 12, 20, 0.75);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.35);
  --shadow-soft: 0 32px 80px rgba(0, 0, 0, 0.7);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --blur-strong: 30px;
  --blob-opacity: 0.32;
  --bg-shift: 0px;
  --bg-hue: 0deg;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient: radial-gradient(circle at top, #2a3140 0, #05060a 55%, #000000 100%);
  }
}

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  font-weight: normal;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  font-size: 15px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-main);
  background: #000;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.08) 0, transparent 50%),
    radial-gradient(circle at 90% 100%, rgba(110, 169, 255, 0.18) 0, transparent 55%),
    var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
  transition: color 0.5s, background-color 0.5s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("pictures/m2.jpg");
  background-size: cover;
  background-position: center;
  z-index: -1;
  pointer-events: none;
}

/* Removed previous blob styles */
/* body::after { ... } */

/* Generic link style */
a {
  text-decoration: none;
  color: var(--accent);
  transition: 0.3s;
}

a:hover {
  background-color: rgba(110, 169, 255, 0.18);
}

/* ===== Intro typing section (full viewport) ===== */
.intro {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

.intro-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.intro-text {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.04em;
  padding: 18px 28px;
  border-radius: var(--radius-pill);
  background: rgba(5, 6, 12, 0.85);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
}

.caret {
  display: inline-block;
  width: 1.2ch;
  height: 1.1em;
  margin-left: 4px;
  border-radius: 2px;
  background: var(--text-main);
  animation: caret-blink 1s step-end infinite;
}

@keyframes caret-blink {

  0%,
  40% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* Scroll hint under the intro */
.scroll-hint {
  font-size: 0.85rem;
  color: rgba(245, 245, 247, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease;
  pointer-events: none;
}

.scroll-hint--visible {
  opacity: 0.75;
  transform: translateY(0);
}

.scroll-arrow {
  font-size: 1.1rem;
  animation: arrow-bob 1.4s ease-in-out infinite;
}

@keyframes arrow-bob {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

/* ===== Scrollable notification-like stream ===== */
/* Stream container - now a fixed overlay */
/* Stream container - High Resolution 12x12 Grid for Precision */
.stream {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 10px;
}

/* Stream cards - Reset positioning */
.stream-card {
  position: relative;
  width: 100%;
  height: fit-content;
  /* Allow height to be determined by content */
  align-self: start;
  /* Prevent stretching to fill grid row */
  /* Fill the grid area width */
  max-width: none;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;

  /* Initial state for animation */
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;

  /* Visual styles */
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  overflow: visible;
  /* Allow content to dictate size, no clipping */
  color: rgba(244, 244, 247, 0.98);
  transform-origin: center center;
  will-change: transform;
  transform: translateZ(0);
  /* Force hardware acceleration */
  backface-visibility: hidden;
}

.stream-card.visible {
  opacity: 1;
  transform: scale(1);
}

/* Circular floating animations */
@keyframes float-circular-cw {
  0% {
    translate: 0 -6px;
  }

  25% {
    translate: 6px 0;
  }

  50% {
    translate: 0 6px;
  }

  75% {
    translate: -6px 0;
  }

  100% {
    translate: 0 -6px;
  }
}

@keyframes float-circular-ccw {
  0% {
    translate: 0 -6px;
  }

  25% {
    translate: -6px 0;
  }

  50% {
    translate: 0 6px;
  }

  75% {
    translate: 6px 0;
  }

  100% {
    translate: 0 -6px;
  }
}

/* 
   USER GUIDE: 12x12 GRID POSITIONING
   ----------------------------------
   The screen is divided into 12 columns and 12 rows.
   Center Text Area is roughly: Rows 5-8, Cols 4-9. KEEP CLEAR.
   
   Syntax: grid-area: row-start / col-start / row-end / col-end;
*/

/* 1. About - Top Right (Moved from Left) */
.stream-card:nth-child(1) {
  grid-area: 2 / 9 / 5 / 12;
}

/* 2. Skills - Top Left (Moved from Right) */
.stream-card:nth-child(2) {
  grid-area: 2 / 4 / 4 / 8;
}

/* 3. Experience - Middle Left (Original width, moved up) */
.stream-card:nth-child(3) {
  grid-area: 4 / 1 / 8 / 4;
  /* Reverted to 3 cols wide, moved up to row 4 */
}

/* 4. Education - Middle Right (Offset from Skills) */
.stream-card:nth-child(4) {
  grid-area: 5 / 10 / 8 / 13;
}

/* 5. Projects - Bottom Left (Under Experience) */
.stream-card:nth-child(5) {
  grid-area: 10 / 3 / 12 / 6;
}

/* 6. Contact - Bottom Right (Under Education) */
.stream-card:nth-child(6) {
  grid-area: 9 / 8 / 12 / 11;
}

/* Add circular floating animation when visible */
.stream-card.visible:nth-child(1) {
  animation: float-circular-cw 12s linear infinite 0s;
}

.stream-card.visible:nth-child(2) {
  animation: float-circular-ccw 14s linear infinite 1s;
}

.stream-card.visible:nth-child(3) {
  animation: float-circular-cw 16s linear infinite 0.5s;
}

.stream-card.visible:nth-child(4) {
  animation: float-circular-ccw 13s linear infinite 1.5s;
}

.stream-card.visible:nth-child(5) {
  animation: float-circular-cw 15s linear infinite 2s;
}

.stream-card.visible:nth-child(6) {
  animation: float-circular-ccw 14s linear infinite 2.5s;
}

/* Hover Interaction: Bring to front */
.stream-card:hover {
  z-index: 100 !important;
  /* Ensure hovered card is always on top */
  transform: scale(1.05) translateY(-5px);
  /* Slight pop effect */
}

/* Custom scrollbar removed as cards are now auto-height */

/* Main style for Chrome */
.stream-card.glass-main {
  background: rgba(0, 0, 0, 0.6) !important;
  box-shadow: none !important;
  border-color: transparent !important;
  border-radius: 22px;
  --edge-width: 7.5px;
}

/* Disable the base ::before (which has screen blend mode) for glass-main to ensure clear center */
.stream-card.glass-main::before {
  content: none;
  display: none;
}

/* Edge Layer (Liquid Glass) */
.stream-card.glass-main::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: var(--edge-width);
  backdrop-filter: url(#liquid-glass-filter);
  -webkit-backdrop-filter: url(#liquid-glass-filter);
  border-radius: 22px;
  z-index: -1;
  background: rgba(0, 0, 0, 0);
  /* <--- CHANGE THIS OPACITY to control "milkyness" of the edge (e.g. 0.1 for milky, 0 for clear) */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  /* Subtle shadow for the edge */
  border: none;
  /* Border on the liquid edge */

  /* Mask out the content box (center), keeping only the border box (edge) */
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

/* Fallback style for other browsers */
.stream-card.glass-fallback {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-radius: 22px;
}

.stream-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0.4);
  border-color: transparent;
}

.stream-card:hover::after {
  backdrop-filter: url(#liquid-glass-filter);
  -webkit-backdrop-filter: url(#liquid-glass-filter);
}

/* subtle edge highlight */
.stream-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 40%),
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(110, 169, 255, 0.26), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.9;
  pointer-events: none;
}

.stream-card>* {
  position: relative;
  z-index: 1;
}

/* Hero card at the top of the stream */
.hero-card {
  padding-top: 15px;
  padding-bottom: 16px;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, #ffffff, #c6d4ff 35%, #4252ff 80%),
    linear-gradient(140deg, #121530, #040514);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.5);
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-name {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.hero-role {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-location {
  margin: 0;
  font-size: 0.8rem;
  color: var(--accent-soft);
}

.hero-tagline {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: rgba(244, 244, 247, 0.9);
}

/* Card headings + text */
.card-title {
  margin: 0 0 4px;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 244, 247, 0.86);
}

.stream-card p,
.stream-card li {
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Pills (skills) */
.pill-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-list li {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(4, 6, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

/* Experience items */
.item {
  margin-top: 6px;
}

.item:first-of-type {
  margin-top: 2px;
}

.item h3 {
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.item-meta {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Projects & contact lists */
.project-list,
.contact-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.project-list li+li,
.contact-list li+li {
  margin-top: 4px;
}

.contact-list li {
  font-variant-numeric: tabular-nums;
}

/* Responsive adjustments */
@media (max-width: 1120px) {
  .intro {
    padding-inline: 14px;
    min-height: 90vh;
    /* Allow stream to be reached sooner */
  }

  .intro-text {
    padding-inline: 18px;
  }

  /* Mobile Layout: Stacked Stream */
  .stream {
    position: relative;
    /* Flow with document */
    inset: auto;
    display: flex;
    flex-direction: column;
    padding: 20px 16px 40px;
    gap: 16px;
    pointer-events: auto;
    overflow-y: visible;
  }

  /* Reset Grid Positioning for all cards */
  .stream-card:nth-child(n) {
    grid-area: auto;
    width: 100%;
    max-width: none;
    /* Disable circular floating animation on mobile */
    animation: none !important;
  }

  .stream-card {
    border-radius: 20px;
  }

  /* Force Notification Style (Fallback) on Mobile */
  /* Override glass-main specific styles */
  .stream-card.glass-main {
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.1) 100%) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 22px;
  }

  /* Hide the liquid edge pseudo-element */
  .stream-card.glass-main::after {
    display: none !important;
  }

  /* Restore the subtle highlight pseudo-element */
  .stream-card.glass-main::before {
    display: block !important;
    content: "" !important;
  }
}