/* ============================================================
   Siva Kishore Reddy Allu — Portfolio
   Minimal editorial theme. Restrained motion: fade-up reveals only.
   ============================================================ */

:root {
  --paper: #FAF6EF;
  --paper-2: #F3EDE1;
  --ink: #1B1611;
  --muted: #6F6455;
  --line: #E5DAC6;
  --accent: #B6491F;
  --accent-hover: #93380F;
  --dark: #161210;
  --cream: #F4EEE3;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Subtle film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent); color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10000;
  background: var(--ink);
  color: var(--cream);
  padding: .6rem 1rem;
  border-radius: 8px;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; color: var(--cream); }

/* ---------- Eyebrow kickers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.eyebrow.on-dark { color: var(--cream); opacity: .75; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: rgba(250, 246, 239, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.monogram {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--cream);
  background: var(--ink);
  border-radius: 9px;
  padding: .42rem .55rem;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.menu {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}
.menu a {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem .65rem;
  border-radius: 8px;
  white-space: nowrap;
}
.menu a:hover { color: var(--ink); background: var(--paper-2); }
.menu a.active {
  color: var(--accent);
  background: rgba(182, 73, 31, .09);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .6rem .65rem;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.menu-toggle span + span { margin-top: 5px; }

/* ---------- Hero ---------- */
.hero { padding: 9.5rem 0 4.5rem; }

.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  margin-bottom: .5rem;
}
.hero .role {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1.4rem;
}
.hero .lede {
  font-size: 1.15rem;
  max-width: 38rem;
  color: var(--ink);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* Inner page headers */
.page-head { padding: 9rem 0 3rem; }
.page-head h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
.page-head .lede { max-width: 40rem; color: var(--muted); font-size: 1.12rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  color: var(--cream);
  background: var(--ink);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--cream); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }

.btn-light { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.btn-light:hover { background: var(--accent); border-color: var(--accent); color: var(--cream); }

.btn-outline-light { background: transparent; border-color: rgba(244, 238, 227, .45); color: var(--cream); }
.btn-outline-light:hover { background: var(--cream); border-color: var(--cream); color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section.alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: .4rem; }
.section-head p { color: var(--muted); max-width: 38rem; margin: 0; }

/* ---------- Stats band ---------- */
.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2.6rem 0;
}
.stat { border-left: 1px solid var(--line); padding-left: 1.5rem; }
.stat:first-child { border-left: none; padding-left: 0; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.9rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: .4rem;
}
.stat-label { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -18px rgba(27, 22, 17, .35);
}
.card .date {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.card h3 { font-size: 1.45rem; margin: 0; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }
.card .spacer { flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.tags li {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .32rem .75rem;
}

.card-links { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: .2rem; }
.card-links a {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.card-links a:hover { color: var(--accent-hover); border-bottom-color: var(--accent-hover); }

/* Skill group cards */
.skill-card h3 { font-size: 1.25rem; }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin: 0; padding: 0 0 0 2rem; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: .55rem;
  top: .4rem;
  bottom: .4rem;
  width: 1px;
  background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.72rem;
  top: .45rem;
  width: .72rem;
  height: .72rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(182, 73, 31, .14);
}
.timeline-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
}
.timeline-card .role-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .3rem;
}
.timeline-card h3 { font-size: 1.6rem; margin: 0; }
.timeline-card .company { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.timeline-card .period { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.timeline-card ul { margin: .9rem 0 0; padding-left: 1.15rem; color: var(--muted); }
.timeline-card li { margin-bottom: .45rem; }
.timeline-card li::marker { color: var(--accent); }

/* ---------- About layout ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: start; }
.about-grid .prose p { color: var(--ink); }
.fact-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.fact-list dt, .fact-list .k { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact-list dd, .fact-list .v { margin: 0; text-align: right; }
.fact-list .v a { color: var(--ink); }
.fact-list .v a:hover { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-size: .92rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: .5rem 1.05rem;
}

/* ---------- Contact cards ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.5rem; }
.contact-card { text-align: left; }
.contact-card .k { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.contact-card a.big { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); word-break: break-all; }
.contact-card a.big:hover { color: var(--accent); }

/* ---------- Certifications ---------- */
.cert-group { margin-bottom: 2.6rem; }
.cert-group:last-child { margin-bottom: 0; }
.cert-group h3 {
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.cert-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.cert-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem .25rem;
  border-bottom: 1px solid var(--line);
}
.cert-list .name { font-weight: 500; }
.cert-list .meta { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: var(--cream); padding: 5rem 0 2rem; margin-top: 5rem; }
.footer h2 { font-size: clamp(2.2rem, 5.5vw, 4rem); max-width: 16ch; margin-bottom: 1.8rem; }
.footer-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 3.5rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  border-top: 1px solid rgba(244, 238, 227, .16);
  padding-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: rgba(244, 238, 227, .62);
}
.footer-bottom p { margin: 0; }

/* ---------- Centered / misc ---------- */
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.link-more {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
}

/* 404 */
.notfound { padding: 10rem 0 6rem; text-align: center; }
.notfound h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }

/* ---------- Reveal motion (the only animation) ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); }
html.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .6s ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .reveal.in { transition: none; }
  .card:hover, .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 860px) {
  .brand-name { display: none; }
  .menu-toggle { display: block; }
  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: .75rem 1.5rem 1.25rem;
    gap: .15rem;
  }
  .menu.open { display: flex; }
  .menu a { padding: .7rem .4rem; font-size: .85rem; }
}

@media (max-width: 768px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .stat { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.4rem; }
  .stat:first-child { border-top: none; padding-top: 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 8rem; }
  .page-head { padding-top: 7.5rem; }
  .section { padding: 3.5rem 0; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .wrap { padding-left: 1.1rem; padding-right: 1.1rem; }
  .hero .lede { font-size: 1.05rem; }
  .card { padding: 1.4rem; }
  .timeline { padding-left: 1.5rem; }
  .timeline::before { left: .4rem; }
  .timeline-item::before { left: -1.37rem; }
  .footer { padding-top: 3.5rem; }
  .cert-list li { flex-direction: column; gap: .2rem; align-items: flex-start; }
}
