/* ==========================================================================
   KAPIL SANKAR - PURE MONOCHROME DESIGN SYSTEM
   Strict Pitch Black (#000000) & Pure White (#ffffff) Editorial Craft
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@300;400;500;600;700&family=Press+Start+2P&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- Root Variables: Strict Monochrome Tokens --- */
:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;
  --font-tamil: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Latha', 'Nirmala UI', 'Tamil Sangam MN', sans-serif;

  /* Pure White Mode Tokens */
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-elevated: #f5f5f5;
  --bg-subtle: #fafafa;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --text-primary: #000000;
  --text-secondary: #262626;
  --text-muted: #525252;
  --text-subtle: #737373;

  --border-color: #e5e5e5;
  --border-hover: #a3a3a3;
  --border-active: #525252;

  --accent-color: #000000;
  --accent-hover: #262626;
  --accent-light: rgba(0, 0, 0, 0.05);

  --card-bg: #ffffff;
  --card-border: #e5e5e5;
  --card-hover-border: #a3a3a3;

  --dot-color: rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.1);

  --badge-bg: #000000;
  --badge-text: #ffffff;

  --screen-line: #e5e5e5;
}

/* --- Pitch Black Dark Mode Tokens --- */
[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #000000;
  --bg-elevated: #0a0a0a;
  --bg-subtle: #050505;
  --bg-glass: rgba(0, 0, 0, 0.92);

  --text-primary: #ffffff;
  --text-secondary: #d4d4d4;
  --text-muted: #8a8a8a;
  --text-subtle: #525252;

  --border-color: #171717;
  --border-hover: #2e2e2e;
  --border-active: #525252;

  --accent-color: #ffffff;
  --accent-hover: #e5e5e5;
  --accent-light: rgba(255, 255, 255, 0.08);

  --card-bg: #000000;
  --card-border: #171717;
  --card-hover-border: #2e2e2e;

  --dot-color: rgba(255, 255, 255, 0.35);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.8);
  --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.95);

  --badge-bg: #ffffff;
  --badge-text: #000000;

  --screen-line: #171717;
}

/* --- Base & Reset with Smooth Transitions --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-primary);
  -webkit-text-size-adjust: 100%;
}

html:not(.lenis) {
  scroll-behavior: smooth;
}

/* Lenis Smooth Scroll Engine */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Native Cross-Document View Transitions for Zero-Glitch Navigation --- */
@view-transition {
  navigation: auto;
}

/* --- Soft & Elegant Global Theme & Navigation Cross-Fade --- */
::view-transition-group(root) {
  animation-duration: 0.28s;
}

::view-transition-old(root) {
  animation: 0.28s cubic-bezier(0.25, 1, 0.5, 1) both themeFadeOut;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: 0.28s cubic-bezier(0.25, 1, 0.5, 1) both themeFadeIn;
  mix-blend-mode: normal;
}

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

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

/* --- Single-Page View Architecture --- */
.page-view {
  display: none;
}

.page-view.active-view {
  display: block;
}

/* Fallback for browsers without View Transitions */
@supports not (view-transition-name: root) {
  html, body, .site-header, .layout-container, .project-card, .btn-primary, .btn-secondary, .connect-pill, .skill-pill {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

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

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

/* --- Accessibility Skip Link --- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--text-primary);
}

/* --- Layout Container & Hairline Grid Borders --- */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  border-left: 1px solid var(--screen-line);
  border-right: 1px solid var(--screen-line);
  position: relative;
  background: var(--bg-primary);
  box-sizing: border-box;
}

.layout-container {
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  box-sizing: border-box;
}

/* Screen Line Dividers (Edge-to-Edge Seamless Intersections) */
.screen-line {
  height: 1px;
  width: 100%;
  background-color: var(--screen-line);
  position: relative;
  border: none;
  margin: 0;
  display: block;
}

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

.screen-line-bottom {
  border-bottom: 1px solid var(--screen-line);
}

/* --- Navigation Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  border-bottom: 1px solid var(--screen-line);
  box-sizing: border-box;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  width: 100%;
  box-sizing: border-box;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  outline: none;
}

.brand-logo:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.brand-text {
  font-family: var(--font-pixel);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 16px;
}

@media (min-width: 640px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 9999px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.control-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.theme-toggle-btn svg {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .theme-toggle-btn svg {
  transform: rotate(180deg);
}

/* --- Interactive Canvas Hero Header --- */
.hero-canvas-container {
  width: 100%;
  height: 96px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--screen-line);
  background: var(--bg-primary);
}

@media (min-width: 640px) {
  .hero-canvas-container {
    height: 128px;
  }
}

#dotCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Profile / Bio Hero Section --- */
.hero-profile {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 16px;
  background: var(--bg-primary);
}

.avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.avatar-frame {
  width: 76px;
  height: 76px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  position: relative;
}

@media (min-width: 640px) {
  .avatar-frame {
    width: 88px;
    height: 88px;
  }
}

.avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.avatar-frame:hover .avatar-img {
  transform: scale(1.04);
}

/* Hero Content */
.hero-content {
  flex: 1;
  min-width: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 26px;
  }
}

.role-cycler {
  display: flex;
  align-items: center;
  height: 26px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .role-cycler {
    font-size: 15px;
  }
}

.role-text-track {
  position: relative;
  display: inline-block;
  overflow: hidden;
  height: 24px;
}

.role-text-item {
  color: var(--text-primary);
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.location-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--border-hover);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

/* --- Section Containers --- */
.portfolio-section {
  width: 100%;
  position: relative;
  background: var(--bg-primary);
}

.section-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--screen-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-body {
  padding: 20px 16px;
}

@media (min-width: 640px) {
  .section-body {
    padding: 24px 20px;
  }
}

/* --- About List Narrative --- */
.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-item {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .about-item {
    font-size: 15px;
  }
}

.about-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.4;
}

.highlight-term {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-active);
}

/* --- Connect Pills Grid --- */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 640px) {
  .connect-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.connect-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  width: 100%;
}

.connect-pill:hover {
  background: var(--badge-bg);
  color: var(--badge-text);
  border-color: transparent;
  transform: translateY(-1px);
}

.connect-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* --- Education & Trajectory Timeline --- */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 17px;
  width: 1px;
  background: var(--screen-line);
  z-index: 0;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.timeline-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.timeline-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.timeline-badge {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* --- Projects Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--screen-line);
  transition: background 0.15s ease;
}

.project-card:hover {
  background: var(--bg-elevated);
}

@media (min-width: 640px) {
  .project-card:nth-child(odd) {
    border-right: 1px solid var(--screen-line);
  }
}

.project-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-action-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-mini-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.project-mini-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.project-mini-link svg {
  width: 11px;
  height: 11px;
}

.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Skills & Categories --- */
.skills-domain-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-category-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-category-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.skill-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.skill-pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

/* --- 4-Way Focus Matrix (Pure Monochrome Radar) --- */
.focus-matrix-container {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background: var(--bg-primary);
}

.focus-venn-diagram {
  position: relative;
  width: 280px;
  height: 280px;
}

@media (min-width: 640px) {
  .focus-venn-diagram {
    width: 360px;
    height: 360px;
  }
}

.venn-circle {
  position: absolute;
  width: 55%;
  height: 55%;
  border-radius: 50%;
  border: 1px dashed var(--border-color);
  background: transparent;
  transition: border-color 0.3s ease;
}

.venn-circle.top {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.venn-circle.bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.venn-circle.left {
  top: 22%;
  left: 2%;
}

.venn-circle.right {
  top: 22%;
  right: 2%;
}

.venn-label {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

@media (min-width: 640px) {
  .venn-label {
    font-size: 13px;
  }
}

.venn-label.top {
  top: 14%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.venn-label.bottom {
  bottom: 14%;
  left: 50%;
  transform: translate(-50%, 50%);
}

.venn-label.left {
  top: 50%;
  left: 12%;
  transform: translate(-50%, -50%);
}

.venn-label.right {
  top: 50%;
  right: 12%;
  transform: translate(50%, -50%);
}

.venn-center-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: #ffffff;
  box-shadow: var(--shadow-md);
  z-index: 5;
}

@media (min-width: 640px) {
  .venn-center-avatar {
    width: 76px;
    height: 76px;
  }
}

.venn-center-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Interactive Contact CTA Box --- */
.contact-cta-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
}

.contact-cta-tagline {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

@media (min-width: 640px) {
  .contact-cta-tagline {
    font-size: 17px;
  }
}

.expandable-connect-btn {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.expandable-connect-btn:hover {
  background: var(--badge-bg);
  color: var(--badge-text);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.expandable-connect-btn .user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--border-color);
  font-size: 9px;
  margin-right: 6px;
}

/* --- Contact Form --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.required-star {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

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

.form-input:focus,
.form-textarea:focus {
  border-color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.form-submit-btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
}

/* --- Thirukkural (திருக்குறள்) Section --- */
.kural-section {
  position: relative;
}

.kural-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kural-badge {
  font-family: var(--font-tamil), var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--border-color);
  letter-spacing: 0.02em;
}

.kural-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 9999px;
}

.kural-timer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-primary);
  animation: pulse-dot 2s infinite ease-in-out;
}

.kural-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (max-width: 480px) {
  .kural-card {
    padding: 16px 14px 14px;
  }
}

@media (max-width: 380px) {
  .kural-card {
    padding: 14px 10px 12px;
  }
}

.kural-slider-wrapper {
  position: relative;
  overflow: hidden;
  min-height: 70px;
  display: flex;
  align-items: center;
}

.kural-couplet {
  font-family: var(--font-tamil);
  font-size: clamp(11px, 3.4vw, 16.5px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: -0.01em;
  width: 100%;
  will-change: transform, opacity;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 380px) {
  .kural-couplet {
    font-size: 10.5px;
    letter-spacing: -0.02em;
  }
}

.kural-couplet.kural-exit {
  opacity: 0;
  transform: translateY(-10px);
}

.kural-couplet.kural-enter-init {
  opacity: 0;
  transform: translateY(12px);
  transition: none;
}

.kural-couplet.kural-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.kural-line1,
.kural-line2 {
  white-space: nowrap;
  display: block;
}

.kural-line1 {
  margin-bottom: 4px;
}

.kural-author {
  font-family: var(--font-tamil), var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* --- Footer --- */
.site-footer {
  padding: 32px 16px;
  text-align: center;
  background: var(--bg-primary);
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-dot-matrix {
  height: 80px;
  width: 100%;
  margin-top: 16px;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 0);
  background-size: 12px 12px;
  background-position: center;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 90%);
}

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1050;
  pointer-events: none;
}

.toast {
  background: var(--badge-bg);
  color: var(--badge-text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  border: 1px solid var(--border-color);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner-icon {
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
