/* ============================================
   Arivalan — Interactive Personal Site
   ============================================ */

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

/* --- Theme Variables --- */
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #181b25;
  --bg-card: #1e2130;
  --bg-card-hover: #262a3a;
  --text-primary: #e8eaf0;
  --text-secondary: #9498a8;
  --text-muted: #8589a0;
  --border: rgba(255, 255, 255, 0.06);
  --accent-1: #6c5ce7;
  --accent-2: #00cec9;
  --accent-3: #0984e3;
  --gradient: linear-gradient(135deg, #6c5ce7, #00cec9);
  --gradient-subtle: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(0,206,201,0.15));
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 12px 40px rgba(0,0,0,0.45);
}

[data-theme="light"] {
  --bg-primary: #f5f6fa;
  --bg-secondary: #ebedf3;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f1f5;
  --text-primary: #1a1c2b;
  --text-secondary: #5a5e72;
  --text-muted: #9498a8;
  --border: rgba(0, 0, 0, 0.06);
  --accent-1: #6c5ce7;
  --accent-2: #00b894;
  --accent-3: #0984e3;
  --gradient: linear-gradient(135deg, #6c5ce7, #00b894);
  --gradient-subtle: linear-gradient(135deg, rgba(108,92,231,0.08), rgba(0,184,148,0.08));
  --shadow-card: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 12px 36px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; font-size: 17px; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection {
  background: var(--accent-1);
  color: #fff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Top Bar --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(15, 17, 23, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease;
}

[data-theme="light"] .topbar {
  background: rgba(245, 246, 250, 0.8);
}

.topbar-logo {
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-surprise, .btn-theme {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-surprise:hover, .btn-theme:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-1);
  transform: translateY(-1px);
}

.btn-theme {
  padding: 0.5rem 0.7rem;
}

.theme-icon { font-size: 1rem; }

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 4rem;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
  opacity: 0.5;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  background: var(--gradient-subtle);
  color: var(--accent-1);
  border: 1px solid rgba(108,92,231,0.2);
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}

.hero-title {
  font-family: 'Sora', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  animation: fadeInDown 0.6s ease 0.15s both;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 500px;
  animation: fadeInDown 0.6s ease 0.3s both;
}

.hero-roles {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  animation: fadeInDown 0.6s ease 0.45s both;
}

.role-label {
  font-size: 1rem;
  color: var(--text-muted);
}

.role-value {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-2);
  min-width: 160px;
  transition: opacity 0.3s ease;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  padding: 0.7rem 1.8rem;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s ease;
  animation: fadeInDown 0.6s ease 0.6s both;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.35);
}

/* --- Section Shared --- */
.section {
  padding: 6rem 0;
}

.section-title {
  font-family: 'Sora', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

/* --- Interest Cards (3D Flip) --- */
.interest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.interest-card {
  position: relative;
  border-radius: 16px;
  perspective: 800px;
  cursor: pointer;
  height: 220px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.interest-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.interest-card:hover .card-inner {
  box-shadow: var(--shadow-card-hover);
}

.card-front {
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.8rem;
}

.card-front h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.card-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.card-back {
  transform: rotateY(180deg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.card-back h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.card-back p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.idea-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.idea-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border-left: 3px solid var(--accent-1);
  line-height: 1.4;
}

.writing-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.chess-stats-mini {
  display: flex;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

.chess-stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: 'Sora', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Stats --- */
.section-stats {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.stat-card {
  text-align: center;
  padding: 1.8rem 1rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.6rem;
}

.stat-number, .stat-number-text {
  font-family: 'Sora', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  display: block;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-number-text {
  font-size: 1.1rem;
  font-weight: 700;
}

.stat-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
  display: block;
}

/* --- Snippets Carousel --- */
.snippets-carousel {
  position: relative;
}

.snippets-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 1rem;
}

.snippets-track::-webkit-scrollbar { display: none; }

.snippet-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  cursor: default;
}

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

.snippet-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.7;
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}

/* --- Random Thoughts --- */
.thoughts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.thoughts-header .section-title {
  margin-bottom: 0;
}

.btn-generate {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 100px;
  background: var(--gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(108,92,231,0.3);
}

.generated-thought {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  min-height: 60px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease;
}

.generated-thought.flash {
  border-color: var(--accent-1);
}

.generated-thought p {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-secondary);
}

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

.thought-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  cursor: default;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  transition: all 0.4s ease;
}

.thought-tile:hover {
  background: var(--accent-1);
  border-color: var(--accent-1);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(108,92,231,0.35);
}

.thought-visible {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: opacity 0.3s ease;
}

.thought-hidden {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  font-size: 0.88rem;
  color: #fff;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  line-height: 1.5;
}

.thought-tile:hover .thought-visible { opacity: 0; }
.thought-tile:hover .thought-hidden { opacity: 1; }

/* --- Chess Section --- */
.section-chess {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.chess-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.chess-title-row .section-title {
  margin-bottom: 0;
}

.chess-profile-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  border: 1px solid rgba(0,206,201,0.25);
  background: rgba(0,206,201,0.08);
  transition: all 0.3s ease;
}

.chess-profile-link:hover {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.chess-info-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
}

.chess-info-centered .chess-ratings-row {
  justify-content: center;
}

.chess-info-centered .chess-record {
  justify-content: center;
}

.chess-info-centered .chess-traits {
  justify-content: center;
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 2px solid var(--border);
}

.board-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: background 0.2s ease;
  cursor: default;
  user-select: none;
}

.board-cell.light { background: #e8dcc8; }
.board-cell.dark { background: #b58863; }

.board-cell:hover {
  filter: brightness(1.1);
}

.chess-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.chess-ratings-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.chess-rating-big {
  display: flex;
  flex-direction: column;
}

.rating-num {
  font-family: 'Sora', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.chess-record {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.record-item {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.record-item.wins { color: #00b894; }
.record-item.losses { color: #e17055; }
.record-item.draws { color: var(--text-muted); }

.chess-last-online {
  margin-top: 0.8rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.chess-card-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.3s ease;
}

.chess-card-link:hover {
  color: var(--accent-1);
}

.rating-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.chess-tagline {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-style: italic;
}

.chess-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trait {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  background: var(--gradient-subtle);
  color: var(--accent-1);
  border: 1px solid rgba(108,92,231,0.15);
}

/* --- Novel --- */
.novel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.novel-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.novel-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  background: var(--gradient);
  color: #fff;
}

.novel-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.novel-hook {
  font-family: 'Sora', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.novel-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.btn-snippet {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-snippet:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
}

.novel-snippet {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 12px;
  border-left: 3px solid var(--accent-2);
}

.novel-snippet-header {
  font-family: 'Sora', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1.2rem;
  margin-bottom: 0;
}

.novel-snippet p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.8;
}

.novel-snippet-tamil {
  font-size: 1rem;
  line-height: 2.2;
}

/* --- Poem Section --- */
.section-poem {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.poem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.poem-header .section-title {
  margin-bottom: 0;
}

.poem-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.poem-seasons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.season-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

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

.season-card.active {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-card-hover), 0 0 0 2px var(--accent-1);
  transform: translateY(-4px);
}

.season-card {
  cursor: pointer;
}

.season-badge {
  display: inline-block;
  font-family: 'Sora', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  background: var(--gradient);
  color: #fff;
  align-self: center;
}

.season-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.season-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.poem-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.poem-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.25s ease;
}

.poem-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), 0 8px 24px rgba(108, 92, 231, 0.12);
}

.poem-text {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 2;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: pre-line;
  margin: 0;
}

.poem-caption {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
}

.poem-card .poem-date {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.poem-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .poem-trio {
    grid-template-columns: 1fr;
  }
}

.snippet-date {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.snippet-caption {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

.poem-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Writing card Tamil poem sample */
.poem-sample {
  margin: 0.8rem 0;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 10px;
  text-align: center;
}

.tamil-poem {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 2;
  color: var(--accent-2);
}

.writing-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

/* --- Personal / Wedding --- */
.personal-card {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 3rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.4s ease;
}

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

.personal-emoji {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.personal-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.personal-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.wedding-link {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  padding: 0.7rem 1.6rem;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.wedding-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.35);
}

/* --- Contact --- */
#contact {
  text-align: center;
}

.contact-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.contact-chip {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.contact-chip:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
  transform: translateY(-2px);
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-copy {
  margin-top: 0.4rem;
  font-size: 0.7rem;
}

/* --- Projects --- */
.projects-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.project-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.3rem;
}

.project-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  margin-top: auto;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--accent-1);
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.6rem 1.2rem;
  background: var(--accent-1);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* --- Back to Top --- */
.btn-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 16px rgba(108,92,231,0.3);
}

.btn-back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108,92,231,0.45);
}

/* --- Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes expandIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  html { font-size: 15px; }
  .hero-title { font-size: 2.8rem; }
  .interest-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .poem-seasons { grid-template-columns: 1fr; }
  .topbar { padding: 0.8rem 1.2rem; }
  .btn-surprise span:not(.theme-icon) { display: none; }
  .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .section-title { font-size: 1.6rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .rating-num { font-size: 2.5rem; }
}
