/* --- 1. VARIABLES & CONFIG --- */
:root {
  /* Palette: Dark Organic */
  --bg: #050505;
  --fg: #e6e4dc; /* Warm bone/cream color instead of stark white */
  --grid-line: rgba(230, 228, 220, 0.15); /* Subtle structure */

  /* Fonts: The Rigid vs The Organic */
  --font-serif:
    'Times New Roman', Times, Baskerville, serif; /* Organic/Classic */
  --font-sans:
    'Helvetica Neue', Helvetica, Arial, sans-serif; /* Brutalist/Bold */
  --font-mono: 'Courier New', Courier, monospace; /* Technical */
}

/* --- 2. RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

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

/* --- 3. BACKGROUND EFFECTS (THE FLUIDITY) --- */

/* Film Grain Texture */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.07;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 4. GLASSMORPHIC UTILITIES --- */
.glass-panel {
  background: rgba(5, 5, 5, 0.2);
  backdrop-filter: blur(10px); /* Frosted glass effect */
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

.border-b {
  border-bottom: 1px solid var(--grid-line);
}
.border-r {
  border-right: 1px solid var(--grid-line);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* --- 5. LAYOUT GRID --- */
.layout-grid {
  display: grid;
  grid-template-rows: auto 1fr auto auto; /* Header, Hero, Marquee, Footer */
  height: 100%;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  border-left: 1px solid var(--grid-line);
  border-right: 1px solid var(--grid-line);
}

/* --- 6. SECTIONS --- */

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
}

.mono-stack {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.dot-indicator {
  width: 8px;
  height: 8px;
  background-color: #4fce5d; /* Tech Green */
  border-radius: 50%;
  box-shadow: 0 0 10px #4fce5d;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

/* Hero Section */
.hero-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  z-index: 2;
}

.mono-spaced-tag {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  letter-spacing: 0.2em;
  color: var(--fg);
  opacity: 0.6;
}

h1 {
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.sans-block {
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Marquee */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  padding: 1.2rem 0;
  cursor: default;
}

.marquee-content {
  display: inline-block;
  animation: scroll 30s linear infinite;
}

.marquee-content span {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  margin: 0 2rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.divider {
  font-family: var(--font-mono);
  opacity: 0.5;
  font-style: normal !important;
}

@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Footer Grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 25vh;
}

.action-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  /* Slight background shift on hover */
}

.action-btn:hover {
  background: rgba(230, 228, 220, 0.05); /* Very subtle light up */
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.6;
  z-index: 2;
}

/* --- THE KINETIC TICKER ANIMATION --- */

.link-text-wrapper {
  /* Height must match the font-size/line-height to crop effectively */
  height: 2rem;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.link-text {
  font-size: 2rem;
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1; /* Ensures text fits tight in the wrapper */
  display: block;
  /* The Physics: Cubic Bezier for that "snappy" Swiss feel */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The Duplicate Text (Ghost) */
.link-text::after {
  content: attr(data-text); /* Grabs text from HTML */
  position: absolute;
  top: 100%; /* Sits directly below visible text */
  left: 0;
  opacity: 0.5; /* Slightly faded for the incoming text */
}

/* The Trigger */

.action-btn:hover .mono-label {
  color: var(--fg);
  opacity: 1;
}

/* --- 7. RESPONSIVE --- */
@media (min-width: 768px) {
  h1 {
    flex-direction: row; /* Side by side on desktop */
    gap: 1rem;
  }

  .action-btn:hover .link-text {
    transform: translateY(-100%); /* Slide everything up */
  }
}

/* --- HERO TITLE KINETIC ENTRANCE --- */

/* 1. The Mask */
.ticker-wrapper {
  overflow: hidden; /* Hides the text when it's "below" the line */
  display: block;
  line-height: 0.9; /* Keeps tight spacing matching your H1 */
  padding-bottom: 0.1em; /* Prevents descenders (g, j, y) from being cut off */
}

/* 2. The Text to Animate */
.ticker-text {
  display: block;
  transform: translateY(110%); /* Start hidden below the mask */
  opacity: 0;

  /* The Physics: Same 'Swiss' curve as the buttons */
  animation: reveal-up 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 3. The Stagger (Delays the last name slightly) */
.delay-1 {
  animation-delay: 0.15s;
}

/* 4. The Animation Keyframes */
@keyframes reveal-up {
  0% {
    transform: translateY(110%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- 8. BLOG SPECIFIC STYLES --- */

/* Allow scrolling for the blog page */
body.scrollable {
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

.blog-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1800px;
  margin: 0 auto;
  border-left: 1px solid var(--grid-line);
  border-right: 1px solid var(--grid-line);
}

/* Sticky Header */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(
    5,
    5,
    5,
    0.8
  ); /* Slightly darker for legibility when scrolling */
}

.back-link {
  transition: opacity 0.3s;
}
.back-link:hover {
  opacity: 0.6;
}

/* Page Intro Section */
.page-intro {
  padding: 4rem 1.5rem 0 1.5rem;
}

.sans-block-sm {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(3rem, 6vw, 6rem); /* Slightly smaller than Hero */
  line-height: 0.9;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.stats-bar {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  opacity: 0.6;
}

.border-t {
  border-top: 1px solid var(--grid-line);
}

/* Year Marker */
.year-marker {
  padding: 2rem 1.5rem;
  font-size: 0.8rem;
  color: var(--fg);
  opacity: 0.4;
  background: rgba(255, 255, 255, 0.02);
}

/* Blog Item Row */
.blog-item {
  display: grid;
  grid-template-columns: 1fr; /* Mobile Default */
  gap: 1rem;
  padding: 2rem 1.5rem;
  text-decoration: none;
  transition: background 0.3s ease;
  align-items: baseline;
}

/* Hover Effect on Row */
.blog-item:hover {
  background: rgba(230, 228, 220, 0.03);
}

/* Trigger Kinetic Text on Row Hover */
.blog-item:hover .link-text {
  transform: translateY(-100%);
}

.blog-item:hover .arrow-icon {
  transform: translateX(5px) translateY(-5px);
  opacity: 1;
}

/* Columns */
.item-meta {
  display: flex;
  gap: 1rem;
  opacity: 0.6;
  font-size: 0.8rem;
}

.category-tag {
  color: #4fce5d; /* Tech Green accent */
}

.item-title {
  font-family: var(--font-sans);
  /* UPDATED: Reduced min size from 1.5rem to 1.1rem */
  font-size: clamp(1.1rem, 4vw, 2.5rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

/* Reuse the wrapper height logic from homepage footer */
.item-title .link-text-wrapper {
  /* UPDATED: Height must match the font-size clamp exactly */
  height: clamp(1.1rem, 4vw, 2.5rem);
  overflow: hidden;
  position: relative;
}

/* NEW: This is crucial. It forces the inner .link-text 
   to respect the smaller mobile size defined above, 
   overriding the global '2rem' setting. */
.item-title .link-text {
  font-size: inherit;
}

.item-read-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

.arrow-icon {
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
}

/* Simple Footer */
.simple-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: auto; /* Pushes to bottom if content is short */
  border-top: 1px solid var(--grid-line);
}

/* Desktop Grid for Blog Items */
@media (min-width: 768px) {
  .blog-item {
    grid-template-columns: 200px 1fr 100px; /* Meta | Title | Time */
    align-items: center;
  }

  .item-title .link-text-wrapper {
    /* Slightly larger on desktop */
    height: clamp(2rem, 3vw, 3rem);
  }

  .item-title {
    font-size: clamp(2rem, 3vw, 3rem);
  }
}
