/* ============================================================
   Sanchith Velmurugan — portfolio
   Palette: light grey → white, dark green accent
   ============================================================ */

:root {
  --bg:          #f4f5f3;   /* light grey */
  --surface:     #ffffff;
  --ink:         #1a1c1a;   /* near-black text */
  --muted:       #5c625b;   /* secondary text */
  --line:        #e2e4df;   /* hairlines */
  --green:       #1f4d36;   /* dark green accent */
  --green-deep:  #17392a;
  --green-tint:  #eef2ee;   /* faint green wash */
  --radius:      14px;
  --maxw:        1040px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle grey→white gradient wash down the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 55%);
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; background: var(--green-tint); color: var(--green-deep); padding: 0.1em 0.4em; border-radius: 5px; }
.accent { color: var(--green); }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: var(--pad-y) 1.25rem;
  font-size: 0.94rem;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              border-color 0.25s var(--ease), background 0.25s var(--ease);
  will-change: transform;
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 8px 22px -12px rgba(31, 77, 54, 0.45);
}
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn--primary:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
  box-shadow: 0 10px 26px -10px rgba(31, 77, 54, 0.6);
}
.btn--sm { --pad-y: 0.5rem; padding: 0.5rem 1rem; font-size: 0.86rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.9rem clamp(1.2rem, 5vw, 3rem);
  max-width: var(--maxw);
  margin: 0 auto;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__brand {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--green);
}
.nav__links {
  display: flex;
  gap: 1.6rem;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav__links a {
  position: relative;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  width: 100%; height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.2rem, 5vw, 3rem); }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; border-top: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 2.2rem; }
.section__num { font-size: 0.85rem; font-weight: 600; color: var(--green); letter-spacing: 0.05em; font-family: ui-monospace, monospace; }
.section__head h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--green);
  background: var(--green-tint);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.3rem;
}
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.2rem); margin-bottom: 1.2rem; }
.hero__lede { font-size: clamp(1.05rem, 2.2vw, 1.28rem); color: var(--muted); max-width: 34ch; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__photo { justify-self: center; }
.hero__photo img {
  width: clamp(220px, 30vw, 320px);
  height: clamp(220px, 30vw, 320px);
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--surface);
  box-shadow: 0 24px 60px -22px rgba(23, 57, 42, 0.5),
              0 0 0 1px var(--line);
}

/* ---------- About ---------- */
.about { display: grid; gap: 1.2rem; max-width: 62ch; font-size: 1.05rem; }
.about p { color: var(--muted); }

/* ---------- Experience timeline ---------- */
.timeline { list-style: none; display: grid; gap: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}
.timeline__item:first-child { border-top: none; }
.timeline__item:hover { background: linear-gradient(90deg, var(--green-tint), transparent 70%); }
.timeline__date { font-size: 0.85rem; font-weight: 600; color: var(--green); font-family: ui-monospace, monospace; }
.timeline__body h3 { font-size: 1.18rem; margin-bottom: 0.15rem; }
.timeline__body h3 .at { font-family: "Inter", sans-serif; font-weight: 500; color: var(--muted); font-size: 0.95rem; }
.timeline__loc { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.7rem; }
.timeline__body ul { list-style: none; display: grid; gap: 0.5rem; }
.timeline__body ul li { position: relative; padding-left: 1.2rem; color: var(--muted); font-size: 0.97rem; }
.timeline__body ul li::before { content: "▸"; position: absolute; left: 0; color: var(--green); font-size: 0.8rem; top: 0.2rem; }

/* ---------- Projects ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 22px 44px -26px rgba(23, 57, 42, 0.45);
}
.card__top { display: flex; align-items: center; justify-content: space-between; }
.card__top h3 { font-size: 1.22rem; }
.card__arrow { color: var(--muted); font-size: 1.1rem; transition: transform 0.3s var(--ease), color 0.3s var(--ease); }
.card:hover .card__arrow { color: var(--green); transform: translate(3px, -3px); }
.card p { color: var(--muted); font-size: 0.96rem; flex: 1; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.76rem; font-weight: 500; color: var(--green-deep); background: var(--green-tint); padding: 0.25rem 0.6rem; border-radius: 6px; }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.skills__group h4 { font-family: "Inter", sans-serif; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.9rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chips li:hover { transform: translateY(-2px); border-color: var(--green); color: var(--green); }

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact { max-width: 52ch; margin: 0 auto; }
.contact .section__num { display: block; margin-bottom: 0.6rem; }
.contact h2 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.contact p { color: var(--muted); margin-bottom: 2rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* ---------- Footer ---------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 2rem clamp(1.2rem, 5vw, 3rem) 3rem; border-top: 1px solid var(--line); }
.footer p { font-size: 0.85rem; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero__photo { order: -1; justify-self: start; }
  .cards, .skills { grid-template-columns: 1fr; }
  .skills { gap: 1.6rem; }
  .timeline__item { grid-template-columns: 1fr; gap: 0.5rem; }
  .nav__links { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover, .chips li:hover { transform: none; }
}
