/* ============================================================
   onkarhoysala.com — main stylesheet
   ============================================================ */

:root {
  --bg: #FAFAF8;
  --text: #1A1A1A;
  --text-secondary: #6B6B6B;
  --accent: #0D9488;
  --accent-light: #ECFDF5;
  --border: #E8E8E4;
  --card-bg: #FFFFFF;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  font-weight: 400;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- NAV ---- */
nav {
  opacity: 0;
  animation: fadeDown 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.1s forwards;
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

nav .nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

nav .nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 450;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

nav .nav-links a:hover { color: var(--text); }
nav .nav-links a.active { color: var(--accent); }

/* Hero-page nav: fixed, transparent, white text */
.has-hero nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  transition: background 0.4s, box-shadow 0.4s;
  z-index: 100;
}
.has-hero nav .logo,
.has-hero nav .nav-links a { color: rgba(255,255,255,0.9); transition: color 0.2s; }
.has-hero nav .nav-links a:hover { color: #fff; }
.has-hero nav .nav-links a.active { color: var(--accent); }

.has-hero nav.scrolled {
  background: var(--bg);
  box-shadow: 0 1px 0 var(--border);
}
.has-hero nav.scrolled .logo { color: var(--text); }
.has-hero nav.scrolled .nav-links a { color: var(--text-secondary); }
.has-hero nav.scrolled .nav-links a:hover { color: var(--text); }
.has-hero nav.scrolled .nav-links a.active { color: var(--accent); }

/* ---- SECTION LABEL ---- */
.section-label {
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-label::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible .section-label::after,
section.visible .section-label::after {
  width: 100%;
  transition-delay: 0.2s;
}

/* ---- HERO (index only) ---- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  background-color: #111;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.80) 0%, transparent 35%),
    linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 72px;
  width: 100%;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(52px, 10vw, 80px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 28px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero h1 .line {
  display: block;
  overflow: hidden;
}

.hero h1 .line-inner {
  display: block;
  transform: translateY(105%);
  animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero h1 .line:nth-child(1) .line-inner { animation-delay: 0.2s; }
.hero h1 .line:nth-child(2) .line-inner { animation-delay: 0.35s; }

.hero .tagline {
  font-size: 19px;
  color: rgba(255,255,255,0.78);
  max-width: 500px;
  line-height: 1.55;
  font-weight: 350;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.7s cubic-bezier(0.23, 1, 0.32, 1) 0.55s forwards;
}

.hero .tagline a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.hero .tagline a:hover { border-bottom-color: var(--accent); }

/* ---- PAGE HEADER (beyond-work only) ---- */
.page-header {
  padding: 80px 0 60px;
}

.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 8vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
}

.page-header h1 em {
  font-style: italic;
  color: var(--accent);
}

.page-header h1 .line {
  display: block;
  overflow: hidden;
}

.page-header h1 .line-inner {
  display: block;
  transform: translateY(105%);
  animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.2s forwards;
}

.page-header .intro {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.6;
  font-weight: 350;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.7s cubic-bezier(0.23, 1, 0.32, 1) 0.45s forwards;
}

/* ---- SECTIONS ---- */
section {
  padding: 64px 0;
  background-image: linear-gradient(var(--border), var(--border));
  background-size: 0% 1px;
  background-position: bottom left;
  background-repeat: no-repeat;
  border-bottom: none;
  transition: background-size 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

section:last-of-type { background-image: none; }
section.visible { background-size: 100% 1px; }

.section-intro {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 350;
  max-width: 560px;
  margin-bottom: 32px;
}

/* ---- REVEAL & STAGGER ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.reveal .stagger {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible .stagger { opacity: 1; transform: translateY(0); }
.reveal.visible .stagger:nth-child(1) { transition-delay: 0.1s; }
.reveal.visible .stagger:nth-child(2) { transition-delay: 0.2s; }
.reveal.visible .stagger:nth-child(3) { transition-delay: 0.3s; }
.reveal.visible .stagger:nth-child(4) { transition-delay: 0.4s; }
.reveal.visible .stagger:nth-child(5) { transition-delay: 0.5s; }

/* ---- NOW ---- */
.now-list {
  display: flex;
  flex-direction: column;
}

.now-item {
  display: block;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s, transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.now-item:last-child { border-bottom: none; }
.now-item:hover { transform: translateX(6px); }
.now-item:hover h3 { color: var(--accent); }

.now-item .now-role {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 450;
  padding-top: 3px;
}

.now-item h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  transition: color 0.2s;
}

.now-item .now-company {
  font-size: 14px;
  color: var(--accent);
  font-weight: 450;
  margin-bottom: 6px;
}

.now-item p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 350;
}

/* ---- TIMELINE ---- */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.timeline-item:last-child { border-bottom: none; }
.timeline-item:hover { transform: translateX(6px); }
.timeline-item:hover h3 { color: var(--accent); transition: color 0.2s; }

.timeline-year {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 450;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.timeline-content h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.timeline-content .timeline-company {
  font-size: 14px;
  color: var(--accent);
  font-weight: 450;
  margin-bottom: 6px;
}

.timeline-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 350;
}

/* ---- BEYOND WORK TEASER ---- */
.beyond-text p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 350;
  margin-bottom: 16px;
}

.beyond-text p:last-child { margin-bottom: 0; }
.beyond-text em { color: var(--text); font-style: italic; }

.beyond-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 450;
  color: var(--accent);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.beyond-link:hover { transform: translateX(4px); }

/* ---- CONNECT ---- */
.connect-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 450;
  background: var(--card-bg);
  transition: border-color 0.2s, color 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.connect-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.connect-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---- TRAVEL ---- */
.travel-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  scrollbar-width: none;
  gap: 16px;
  margin-top: 24px;
  padding-bottom: 8px;
}

.travel-carousel::-webkit-scrollbar { display: none; }

.travel-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
}

.travel-card--passport {
  background: #1a1a1a;
  aspect-ratio: 3/2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passport-placeholder {
  text-align: center;
}

.passport-label {
  font-family: var(--serif);
  font-size: 22px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.passport-year {
  font-family: var(--serif);
  font-size: 72px;
  font-style: italic;
  color: rgba(255,255,255,0.12);
  margin: 0;
  line-height: 1;
}

.travel-card--map {
  aspect-ratio: 3/2;
}

#world-map {
  width: 100%;
  height: 100%;
}

.travel-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.travel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.travel-dot.active {
  background: var(--text-secondary);
}

/* ---- TENNIS ---- */
.tennis-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 40px;
  align-items: center;
  margin-top: 24px;
}

.tennis-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tennis-photo {
  aspect-ratio: 1;
  background: var(--border);
  overflow: hidden;
  border-radius: 2px;
}

.tennis-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tennis-text {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- PHOTO GRID ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

.photo-slot {
  aspect-ratio: 1;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.photo-slot:hover img { transform: scale(1.05); }

.photo-slot:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 450;
  color: var(--accent);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-link:hover { transform: translateX(4px); }

.gallery-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---- SHELF CATEGORY LABEL ---- */
.shelf-category {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin: 32px 0 12px;
}

/* ---- BOOKSHELF ---- */
.shelf-wrapper {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.shelf-scroll {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 24px;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 8px;
  scrollbar-width: none;
}

.shelf-scroll > .book-card:first-child { margin-left: 24px; }
.shelf-scroll > .book-card:last-child  { margin-right: 24px; }

.shelf-scroll::-webkit-scrollbar { display: none; }

.shelf-wrapper::before,
.shelf-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.shelf-wrapper::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.shelf-wrapper::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
  transition: opacity 0.2s;
}

.shelf-wrapper.can-scroll-left::before { opacity: 1; }
.shelf-wrapper.at-end::after { opacity: 0; }

.shelf-ledge {
  height: 8px;
  background: linear-gradient(to bottom, #D8D4CE, var(--bg));
  border-top: 1.5px solid #CBC7C0;
}

.book-card {
  flex: 0 0 auto;
  width: 150px;
  scroll-snap-align: start;
  cursor: default;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.book-card:hover { transform: translateY(-8px); }

.book-cover {
  width: 150px;
  height: 224px;
  border-radius: 2px 5px 5px 2px;
  overflow: hidden;
  background: linear-gradient(145deg, #E8E4DF 0%, #D5D0CA 100%);
  box-shadow: 5px 5px 15px rgba(0,0,0,0.1), 1px 1px 4px rgba(0,0,0,0.06);
  position: relative;
  margin-bottom: 14px;
  transition: box-shadow 0.3s ease;
}

.book-card:hover .book-cover {
  box-shadow: 8px 8px 24px rgba(0,0,0,0.12), 2px 2px 6px rgba(0,0,0,0.06);
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-cover::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(to right, rgba(0,0,0,0.15), rgba(0,0,0,0.02));
  z-index: 1;
}

.book-cover::after {
  content: '';
  position: absolute;
  right: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: repeating-linear-gradient(
    to bottom,
    #F5F2EE 0px, #E8E4E0 1px, #F5F2EE 2px
  );
  border-radius: 0 2px 2px 0;
}

.book-cover.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover.placeholder .placeholder-text {
  font-family: var(--serif);
  font-size: 13px;
  color: #A09A92;
  text-align: center;
  padding: 20px 16px;
  line-height: 1.35;
  font-style: italic;
}

.book-info h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 2px;
  color: var(--text);
}

.book-info .book-author {
  font-size: 12px;
  color: var(--accent);
  font-weight: 450;
  margin-bottom: 5px;
}

.book-info .book-note {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  font-weight: 350;
}

.scroll-hint {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 20px;
  opacity: 0.5;
}

.scroll-hint span {
  display: inline-block;
  animation: nudge 1.5s ease-in-out infinite;
}

/* ---- FOOTER ---- */
footer {
  padding: 40px 0;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

footer.visible { opacity: 1; transform: translateY(0); }

footer p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 350;
}

/* ---- KEYFRAMES ---- */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp { to { transform: translateY(0); } }

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

@keyframes drawLine { to { background-size: 100% 1px; } }

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(4px); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  nav .nav-links { gap: 20px; }

  .hero { min-height: 60vh; }
  .hero-inner { padding-bottom: 56px; }
  .hero h1 { font-size: 44px; margin-bottom: 20px; }
  .hero .tagline { font-size: 17px; }

  .now-item .now-role { font-size: 12px; }

  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-year { font-size: 12px; }

  section { padding: 48px 0; }

  .page-header { padding: 56px 0 44px; }
  .page-header h1 { font-size: 36px; }

  .tennis-layout { grid-template-columns: 1fr; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-slot:nth-child(1) { grid-column: span 1; grid-row: span 1; aspect-ratio: 1; }

  .book-card { width: 130px; }
  .book-cover { width: 130px; height: 192px; }
  .shelf-scroll { gap: 20px; }
}
