/* ============================================================
   Shreehan Santosh Kate — Portfolio
   Design: trajectory rail. A literal tracked path runs the page,
   echoing trajectory-tracking control. Spaced, elevated cards
   replace dense hairline tables. Signal-teal + rust accents.
   Display: Sora · Body: Inter · Data: IBM Plex Mono
   ============================================================ */

:root{
  --paper:    #F6F5F1;
  --card:     #FFFFFF;
  --ink:      #14161A;
  --ink-soft: #5E625F;
  --line:     #E2E0D8;
  --accent:   #0E7C75;
  --accent-soft: #E3F1EF;
  --accent2:  #C2592E;
  --navy:     #0E1830;
  --nav-bg: rgba(246,245,241,0.82);
  --shadow: 0 18px 40px -22px rgba(20,22,26,0.18);

  --display: 'Sora', sans-serif;
  --body:    'Inter', sans-serif;
  --mono:    'IBM Plex Mono', monospace;

  --max: 1080px;
  --rail-w: 64px;
}

[data-theme="dark"]{
  --paper:    #0A0C0F;
  --card:     #14171B;
  --ink:      #ECEDEC;
  --ink-soft: #92968F;
  --line:     #262A28;
  --accent:   #3FBDB3;
  --accent-soft: #122220;
  --accent2:  #E07A4C;
  --navy:     #060810;
  --nav-bg: rgba(10,12,15,0.78);
  --shadow: 0 18px 40px -20px rgba(0,0,0,0.55);
}

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

html{ scroll-behavior: smooth; }

body{
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

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

.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.eyebrow{
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

h1, h2, h3, h4{ font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
h2 em, h1 span{ font-style: normal; color: var(--accent); }

/* ============== TRAJECTORY RAIL (signature element) ============== */
.traj-rail{
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w);
  z-index: 90; display: flex; justify-content: center;
  pointer-events: none;
}
.traj-track{
  position: absolute; top: 48px; bottom: 48px; left: 50%; width: 2px;
  background: var(--line); transform: translateX(-50%);
}
.traj-fill{
  position: absolute; top: 48px; left: 50%; width: 2px; height: 0%;
  background: var(--accent); transform: translateX(-50%);
  transition: height .08s linear;
}
.traj-dots{
  position: absolute; top: 48px; bottom: 48px; left: 50%; transform: translateX(-50%);
  width: 100%; pointer-events: auto;
}
.traj-dot{
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line);
  transition: border-color .25s, background .25s, box-shadow .25s, transform .25s;
  display: flex; align-items: center; justify-content: center;
}
.traj-dot:hover{ transform: translate(-50%, -50%) scale(1.25); }
.traj-dot.active{
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.traj-tip{
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 3px 8px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.traj-dot:hover .traj-tip{ opacity: 1; transform: translateY(-50%) translateX(2px); }

@media (max-width: 900px){
  :root{ --rail-w: 34px; }
  .traj-track{ top: 36px; bottom: 36px; }
  .traj-fill{ top: 36px; }
  .traj-dots{ top: 36px; bottom: 36px; }
  .traj-dot{ width: 9px; height: 9px; }
  .traj-tip{ display: none; }
}

/* ============== NAV ============== */
#nav{
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner{
  max-width: var(--max); margin: 0 auto; padding: 0 28px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.nav-mark{
  font-family: var(--mono); font-weight: 500; font-size: 1rem;
  letter-spacing: 0.04em; border: 1px solid var(--ink); border-radius: 4px;
  padding: 4px 9px;
}
.nav-links{ display: flex; gap: 32px; font-size: 0.9rem; }
.nav-links a{ color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover{ color: var(--ink); }

.nav-right{ display: flex; align-items: center; gap: 14px; }

.theme-toggle{
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 100px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; transition: background .2s, border-color .2s;
}
.theme-toggle:hover{ background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle svg{ width: 17px; height: 17px; }
.theme-toggle .icon-moon{ display: none; }
[data-theme="dark"] .theme-toggle .icon-sun{ display: none; }
[data-theme="dark"] .theme-toggle .icon-moon{ display: block; }

.nav-cta{
  font-size: 0.85rem; font-family: var(--mono);
  border: 1px solid var(--ink); padding: 8px 16px; border-radius: 100px;
  transition: background .2s, color .2s;
}
.nav-cta:hover{ background: var(--ink); color: var(--paper); }

@media (max-width: 760px){
  .nav-links{ display: none; }
}

.menu-toggle{
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 100px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer;
}
.menu-toggle svg{ width: 18px; height: 18px; }

.mobile-menu-backdrop{
  position: fixed; inset: 0; z-index: 150;
  background: rgba(6, 8, 10, 0.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.mobile-menu-backdrop.open{ opacity: 1; pointer-events: auto; }

.mobile-menu{
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160;
  width: min(76vw, 320px);
  display: flex; flex-direction: column;
  padding-top: 88px;
  background: var(--nav-bg); backdrop-filter: blur(18px);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -20px rgba(0,0,0,0.45);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
.mobile-menu.open{ transform: translateX(0); }
.mobile-menu a{
  padding: 17px 28px; font-size: 1.02rem; color: var(--ink-soft);
  border-top: 1px solid var(--line); transition: color .2s, background .2s;
}
.mobile-menu a:first-child{ border-top: none; }
.mobile-menu a:hover{ color: var(--ink); background: var(--accent-soft); }
.mobile-menu-close{
  position: absolute; top: 18px; right: 18px;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 100px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer;
}
.mobile-menu-close svg{ width: 16px; height: 16px; }

@media (max-width: 760px){
  .menu-toggle{ display: flex; }
}

@media (prefers-reduced-motion: reduce){
  .mobile-menu{ transition: none; }
  .mobile-menu-backdrop{ transition: none; }
}

/* Horizontal mobile bar retired in favor of the vertical rail at all sizes;
   markup stays in HTML but is kept hidden. */
.traj-rail-mobile{ display: none; position: relative; height: 3px; background: var(--line); overflow: hidden; }
.traj-track-h{ position: absolute; inset: 0; }
.traj-fill-h{ position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--accent); transition: width .08s linear; }

@media (max-width: 560px){
  .nav-cta{ display: none; }
}

/* ============== HERO ============== */
.hero{ position: relative; overflow: hidden; padding-top: 40px; }
.hero-grid{
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: var(--line); opacity: 0.5; z-index: 0;
}
.hero-inner{
  position: relative; z-index: 1;
  max-width: var(--max); margin: 0 auto;
  padding: 76px 28px 100px max(28px, calc(var(--rail-w) + 28px));
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center;
}
.hero-text h1{
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.7rem, 5.6vw, 4.4rem);
  line-height: 1.02; margin-bottom: 1.1rem; letter-spacing: -0.02em;
}
.hero-sub{
  font-family: var(--mono); font-size: 1.02rem; color: var(--accent);
  margin-bottom: 1.3rem;
}
.hero-desc{
  max-width: 54ch; color: var(--ink-soft); font-size: 1.04rem; margin-bottom: 2.1rem;
}
.hero-desc strong{ color: var(--ink); font-weight: 600; }
.hero-links{ display: flex; gap: 14px; }
.hero-links a{
  font-size: 0.88rem; font-family: var(--mono);
  border: 1px solid var(--ink); padding: 9px 16px; border-radius: 100px;
  transition: background .2s, color .2s;
}
.hero-links a:hover{ background: var(--ink); color: var(--paper); }

.hero-affiliations{ margin-top: 2.6rem; }
.aff-label{
  display: block; font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-soft); margin-bottom: 14px;
}
.aff-logos{ display: flex; flex-wrap: wrap; gap: 12px; }
.aff-badge{
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; padding: 9px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
  transition: transform .2s ease, border-color .2s ease;
}
.aff-badge:hover{ transform: translateY(-2px); border-color: var(--accent); }
.aff-badge img{ max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

@media (max-width: 860px){
  .hero-affiliations{ display: flex; flex-direction: column; align-items: center; }
  .aff-logos{ justify-content: center; }
}

.hero-photo{ position: relative; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.photo-frame{
  width: 100%; max-width: 340px; aspect-ratio: 3/4;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--navy);
}
.photo-frame img{ width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(0.06) contrast(1.03); }
.response-curve{
  width: 100%; max-width: 300px; height: auto; color: var(--accent); margin-top: -8px;
}
.curve-label{
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink-soft);
  letter-spacing: 0.03em; margin-top: -6px;
}

@media (max-width: 860px){
  .hero-inner{ grid-template-columns: 1fr; padding-top: 40px; padding-left: max(28px, calc(var(--rail-w) + 28px)); }
  .hero-photo{ order: -1; max-width: 260px; margin: 0 auto; }
}

/* ============== SECTIONS ============== */
.section{ padding: 104px 0; position: relative; }
.section.alt{ background: var(--card); }
.section-inner{
  max-width: var(--max); margin: 0 auto;
  padding: 0 28px 0 max(28px, calc(var(--rail-w) + 28px));
}
.section h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 3rem; }

@media (max-width: 900px){
  .section-inner{ padding: 0 28px 0 max(28px, calc(var(--rail-w) + 28px)); }
}

/* Shared elevated-card look, replacing the old hairline-grid pattern */
.elevated{
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.elevated:hover{ transform: translateY(-3px); border-color: var(--accent); }

/* ============== EDUCATION ============== */
.edu-grid{ display: flex; flex-direction: column; gap: 18px; }
.edu-card{ padding: 28px; display: grid; grid-template-columns: 84px 1fr; gap: 24px; align-items: center; }
.edu-logo{
  width: 84px; height: 84px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.edu-logo img{ max-width: 70%; max-height: 70%; object-fit: contain; }
.edu-logo-fallback{
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500; color: var(--accent);
  letter-spacing: 0.04em;
}
.edu-date{ font-family: var(--mono); font-size: 0.74rem; color: var(--accent); letter-spacing: 0.03em; }
.edu-info h3{ font-size: 1.18rem; margin: 4px 0 4px; }
.edu-org{ font-family: var(--mono); font-size: 0.84rem; color: var(--ink-soft); margin-bottom: 8px; }
.edu-note{ font-size: 0.92rem; color: var(--ink-soft); }

@media (max-width: 600px){
  .edu-card{ grid-template-columns: 1fr; text-align: left; }
  .edu-logo{ width: 64px; height: 64px; }
}

/* ============== TIMELINE ============== */
.timeline{ display: flex; flex-direction: column; gap: 18px; }
.t-row{
  display: grid; grid-template-columns: 200px 1fr; gap: 32px;
  padding: 30px 28px;
}
.t-date{
  font-family: var(--mono); font-size: 0.78rem; color: var(--accent);
  letter-spacing: 0.03em; padding-top: 2px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
}
.t-logos{ display: flex; flex-wrap: wrap; gap: 8px; }
.t-logo-badge{
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; padding: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
}
.t-logo-badge img{ max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.t-content h3{ font-size: 1.2rem; margin-bottom: 4px; }
.t-org{ font-family: var(--mono); font-size: 0.84rem; color: var(--ink-soft); margin-bottom: 12px; }
.t-content ul{ padding-left: 1.1rem; display: flex; flex-direction: column; gap: 7px; }
.t-content li{ font-size: 0.94rem; color: var(--ink-soft); }
.t-content li::marker{ color: var(--accent); }
.t-link{
  display: inline-block; margin-top: 12px; font-family: var(--mono); font-size: 0.78rem;
  color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.t-link:hover{ border-color: var(--accent); }

@media (max-width: 700px){
  .t-row{ grid-template-columns: 1fr; gap: 8px; padding: 24px 22px; }
}

/* ============== AWARDS ============== */
.award-list{ display: flex; flex-direction: column; gap: 18px; }
.award{ padding: 24px 28px; }
.award-tag{
  display: inline-block; font-family: var(--mono); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent2);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 100px; margin-bottom: 12px;
}
.award h3{ font-size: 1.04rem; margin-bottom: 6px; font-weight: 500; }
.award-org{ font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); }
.award-note{ font-size: 0.9rem; color: var(--ink-soft); margin-top: 8px; max-width: 68ch; }

/* ============== PUBLICATIONS ============== */
.pub-list{ display: flex; flex-direction: column; gap: 18px; }
.pub{ padding: 26px 28px; }
.pub-tag{
  display: inline-block; font-family: var(--mono); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 100px; margin-bottom: 12px;
}
.pub h3{ font-size: 1.08rem; margin-bottom: 8px; line-height: 1.4; font-weight: 500; }
.pub-venue{ font-family: var(--mono); font-size: 0.84rem; color: var(--ink-soft); margin-bottom: 12px; }
.pub-link{
  display: inline-block; font-family: var(--mono); font-size: 0.78rem;
  color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.pub-link:hover{ border-color: var(--accent); }
.pub-link[data-pending="true"]{ color: var(--ink-soft); cursor: default; pointer-events: none; }

/* ============== PROJECTS ============== */
.project-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.project-card{ overflow: hidden; padding: 30px 28px; display: flex; flex-direction: column; gap: 10px; }
.project-media{
  width: calc(100% + 56px); margin: -30px -28px 4px;
  aspect-ratio: 16/9; overflow: hidden; background: #fff;
  border-bottom: 1px solid var(--line);
}
.project-media img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease;
}
.project-card:hover .project-media img{ transform: scale(1.04); }
.project-tag{ font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent2); }
.project-card h3{ font-size: 1.12rem; line-height: 1.35; }
.project-card p{ font-size: 0.92rem; color: var(--ink-soft); flex-grow: 1; }
.project-footer{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px;
}
.project-date{ font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); }
.project-link{
  font-family: var(--mono); font-size: 0.74rem; color: var(--accent);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.project-link:hover{ border-color: var(--accent); }
.project-link[data-pending="true"]{ color: var(--ink-soft); cursor: default; pointer-events: none; }

@media (max-width: 700px){
  .project-grid{ grid-template-columns: 1fr; }
}

/* ============== SKILLS ============== */
.skills-grid{ display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 48px; }
.skill-group h4{
  font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--ink-soft); font-weight: 500; margin-bottom: 14px;
}
.tags{ display: flex; flex-wrap: wrap; gap: 8px; }
.tags span{
  font-size: 0.84rem; padding: 7px 14px; border: 1px solid var(--line);
  border-radius: 100px; background: var(--card);
  transition: border-color .2s, color .2s;
}
.tags span:hover{ border-color: var(--accent); color: var(--accent); }

@media (max-width: 700px){
  .skills-grid{ grid-template-columns: 1fr; }
}

/* ============== CONTACT ============== */
.contact-section{ text-align: center; }
.contact-section .eyebrow{ justify-content: center; }
.contact-desc{ max-width: 46ch; margin: 0 auto 2.4rem; color: var(--ink-soft); }
.contact-links{ display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-btn{
  font-family: var(--mono); font-size: 0.9rem;
  background: var(--ink); color: var(--paper);
  padding: 13px 26px; border-radius: 100px;
  border: 1px solid var(--ink);
  transition: opacity .2s;
}
.contact-btn:hover{ opacity: 0.82; }
.contact-btn.outline{ background: transparent; color: var(--ink); }
.contact-btn.outline:hover{ background: var(--ink); color: var(--paper); opacity: 1; }

/* ============== FOOTER ============== */
footer{ border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner{
  max-width: var(--max); margin: 0 auto;
  padding: 0 28px 0 max(28px, calc(var(--rail-w) + 28px));
  display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-soft); font-family: var(--mono);
}
@media (max-width: 900px){ .footer-inner{ padding: 0 28px 0 max(28px, calc(var(--rail-w) + 28px)); } }

@media (max-width: 500px){
  .footer-inner{ flex-direction: column; gap: 6px; text-align: center; }
}

/* ============== MOTION ============== */
.reveal{ opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in{ opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal{ opacity: 1; transform: none; transition: none; }
  .traj-fill{ transition: none; }
}

/* focus visibility */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px;
}
