/* =========================================
   VIVEK REDDY CHENNU — Resume (style.css)
   Centered column • Justified text • h3 left
   ========================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap");

/* ---------- Gentle reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: #1d4ed8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid #14b8a6;
  outline-offset: 3px;
}

/* ---------- Theme tokens ---------- */
:root {
  --bg: #f6f8fc; /* page background */
  --surface: #ffffff; /* card bg */
  --text: #0b1220; /* primary text */
  --muted: #475569; /* secondary text */
  --border: #e5e7eb; /* card border */
  --accent: #2563eb; /* blue */
  --accent-2: #14b8a6; /* teal */

  --radius: 14px;
  --shadow: 0 10px 18px rgba(2, 6, 23, 0.06);
  --maxw: 880px; /* centered column width */
}

/* ---------- Base layout ---------- */
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding: 24px; /* page breathing room */
}

/* Center every top-level section */
body > * {
  max-width: var(--maxw);
  margin-inline: auto; /* centered column */
}

/* ---------- Top: Name + Contact ---------- */
h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.2px;
  text-align: center; /* keep your name centered */
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; /* reveals gradient */
}

#contact {
  margin: 0 0 26px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Link “chips” inside contact */
#contact a {
  color: #0b1220;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  transition: transform 0.06s ease, background 0.2s ease;
}
#contact a:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* Tiny icons */
#contact a[href^="mailto:"]::before {
  content: "✉︎";
  font-size: 0.95em;
}
#contact a[href*="linkedin.com"]::before {
  content: "in";
  font-weight: 800;
  font-size: 0.8em;
  line-height: 1;
  color: #fff;
  background: #0a66c2;
  padding: 3px 6px;
  border-radius: 6px;
}

/* ---------- Headings & Sections ---------- */
/* h3 must be left-aligned per your requirement */
h3 {
  margin: 28px 0 10px;
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 800;
  letter-spacing: 0.2px;
  text-align: left;
  position: relative;
  padding-bottom: 6px;
}
h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 110px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

h4 {
  margin: 10px 0 6px;
  font-size: 16px;
  font-weight: 600;
}

/* Turn immediate section content into clean “cards” */
h3 + p,
h3 + ul,
h3 + .flexcontainer + ul,
.flexcontainer + ul {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px 18px 28px; /* extra left gutter */
  box-shadow: var(--shadow);
  margin: 10px 0 0 0;
}

/* ---------- Justified content text ---------- */
p,
li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* ---------- Lists ---------- */
ul {
  padding-left: 28px;
  margin: 0;
}
ul > li {
  margin: 8px 0;
  padding-left: 2px;
}
ul > li::marker {
  color: var(--accent-2);
}

/* Nested skill lists */
ul ul {
  margin-top: 6px;
  padding-left: 22px;
  border-left: 2px dashed #e5e7eb;
}

/* ---------- Role | Dates row ---------- */
.flexcontainer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 16px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.flexcontainer span:first-child b {
  font-weight: 800;
}
.flexcontainer span:nth-last-child b {
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.12),
    rgba(20, 184, 166, 0.12)
  );
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* ---------- Small polish ---------- */
@media (hover: hover) {
  h3 + ul li:hover,
  .flexcontainer + ul li:hover {
    background: linear-gradient(
      90deg,
      rgba(37, 99, 235, 0.07),
      transparent 45%
    );
    border-radius: 8px;
    transition: background 0.18s ease-out;
    padding-left: 6px;
  }
}

/* Long URLs (LinkedIn) wrap nicely */
a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---------- Print (A4 friendly) ---------- */
@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --text: #000;
    --muted: #333;
    --border: #ddd;
    --shadow: none;
  }
  body {
    background: #fff;
    padding: 0.6in;
    font-size: 11pt;
  }
  h1 {
    color: #000;
    background: none;
    -webkit-background-clip: initial;
  }
  #contact {
    box-shadow: none;
  }
  #contact a {
    background: transparent;
    border: none;
    padding: 0;
  }
  h3::after {
    background: #000;
  }
  h3 + p,
  h3 + ul,
  h3 + .flexcontainer + ul,
  .flexcontainer + ul {
    box-shadow: none;
  }
  h3,
  .flexcontainer,
  ul {
    break-inside: avoid;
  }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 480px) {
  #contact {
    gap: 6px 10px;
    padding: 10px 12px;
  }
  #contact a {
    padding: 5px 9px;
  }
}
/* removed fixed left margin for responsiveness */
/* (moved into containerized layout rules above) */

div {
  margin-left: 0px;
  text-align: justify;
}
/* ===============================
   Circular Skills Meters (0–10y)
   =============================== */

.skills-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 14px);
  padding: 18px 22px;
  box-shadow: var(--shadow, 0 10px 18px rgba(2, 6, 23, 0.06));
  margin: 10px 0 0 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 18px;
  align-items: start;
}

.skill {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

/* Circular ring */
/* 5-YEAR SCALE RINGS */
.ring {
  /* Size & thickness (unchanged) */
  --size: 96px;
  --thickness: 10px;

  /* Colors (unchanged) */
  --ring-track: #e6edf5;
  --ring-fill: var(--accent, #2563eb);

  /* Years: clamp 0..5; 1 unit = 72deg (360/5) */
  --y: clamp(0, var(--years, 0), 5);
  --angle: calc(var(--y) * 72deg);

  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(
    var(--ring-fill) var(--angle),
    var(--ring-track) 0
  );

  /* Hollow center to form a ring */
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--thickness)),
    #000 0
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--thickness)),
    #000 0
  );

  position: relative;
  display: grid;
  place-items: center;
}

/* Tick marks each 1/5 of the circle */
.ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(2, 6, 23, 0.14) 0 1deg,
    transparent 1deg 72deg
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--thickness)),
    #000 0
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--thickness)),
    #000 0
  );
  pointer-events: none;
}

/* Value badge inside */
.ring > span {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text, #0b1220);
  line-height: 1;
  background: #f8fafc;
  border: 1px solid var(--border, #e5e7eb);
  padding: 2px 6px;
  border-radius: 999px;
}

/* Label */
.skill .label {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Compact variant so the section stays tight */
.skills-grid.compact {
  gap: 14px;
}
.skills-grid.compact .ring {
  --size: 78px;
  --thickness: 9px;
}
.skills-grid.compact .label {
  font-size: 0.9rem;
}
.skills-grid.compact .ring > span {
  font-size: 0.9rem;
}

/* Small screens */
@media (max-width: 420px) {
  .skills-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
  }
  .skills-grid.compact .ring {
    --size: 70px;
    --thickness: 8px;
  }
}

/* Print */
@media print {
  .skills-card {
    box-shadow: none;
  }
  .ring::after {
    background: repeating-conic-gradient(#bbb 0 1deg, transparent 1deg 36deg);
  }
}

/* ======= v2 Additions: Navbar, Hero, Projects, Dark Mode ======= */

/* Dark mode token overrides */
:root.dark {
  --bg: #0b1220;
  --surface: #101826;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: #1f2937;
  --accent: #60a5fa;
  --accent-2: #34d399;
  --shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Sticky navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(8px);
  background: color-mix(in hsl, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin: 8px auto 16px;
  max-width: var(--maxw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.navbar .brand {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.navbar .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.navbar .links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: var(--text);
}
:root.dark .navbar .links a {
  background: #0f172a;
  border-color: #1f2937;
}

/* Dark-mode toggle button */
#theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}

/* Hero section */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(
      1200px 400px at 10% -10%,
      rgba(99, 102, 241, 0.18),
      transparent
    ),
    radial-gradient(
      1000px 400px at 110% 10%,
      rgba(20, 184, 166, 0.14),
      transparent
    );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 46px);
  margin-bottom: 14px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: center;
}
@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}
.hero h1 {
  text-align: left;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(30px, 5.4vw, 48px);
  margin: 0 0 8px;
}
.hero .tagline {
  font-weight: 600;
  color: var(--muted);
  margin: 6px 0 12px;
}
.hero .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
}
.btn.secondary {
  background: transparent;
  color: var(--text);
}

/* Headshot */
.headshot {
  width: clamp(160px, 40vw, 220px);
  aspect-ratio: 1/1;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  margin-inline: auto;
}

/* Section anchors spacing fix for sticky nav */
.section {
  scroll-margin-top: 90px;
}

/* Project cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: transform 0.08s ease, background 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
}
.card h4 {
  margin-top: 0;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.85rem;
  background: #f1f5f9;
}
:root.dark .tag {
  background: #0f172a;
}

/* Contact form */
.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.contact-form input,
.contact-form textarea,
.contact-form button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
.contact-form textarea {
  grid-column: 1 / -1;
  min-height: 140px;
}
.contact-form button {
  width: fit-content;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}
@media (max-width: 640px) {
  .contact-form {
    grid-template-columns: 1fr;
  }
}

/* Footer small print */
.footer {
  color: var(--muted);
  text-align: center;
  margin: 18px 0 6px;
  font-size: 0.9rem;
}

/* ===== v3 Layout Fix: center ALL top-level sections consistently ===== */
body > :not(script):not(style) {
  max-width: var(--maxw);
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Explicitly center headings, paragraphs, lists as direct children */
body > h1,
body > h2,
body > h3,
body > p,
body > ul,
body > .flexcontainer,
body > nav,
body > section,
body > div,
body > footer {
  max-width: var(--maxw);
  margin-inline: auto !important;
}

/* Kill any legacy offsets that could shove content left/right */
body {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
div {
  margin-left: 0 !important;
}

/* Minor: ensure hero/navbar look identical width to the rest */
.navbar,
.hero {
  max-width: var(--maxw);
  margin-inline: auto;
}

/* === Contact Form Styles (theme-aware) === */
#contact {
  max-width: var(--maxw);
  margin: 16px auto;
  padding: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

#contact h2 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
  text-align: center;
  color: var(--text);
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 680px; /* keeps fields comfy on wide screens */
  margin-inline: auto;
}

#contact-form label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

#contact-form input,
#contact-form textarea {
  margin-top: 0.4rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font: inherit;
}

#contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

#contact-form input::placeholder,
#contact-form textarea::placeholder {
  color: color-mix(in srgb, var(--text) 55%, transparent);
}

#contact-form button {
  background: var(--text);
  color: var(--bg);
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.2s ease;
}

#contact-form button:hover {
  filter: brightness(1.05);
}

#contact-status {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
