/* ==========================================================================
   Vamsi Krishna Patta — portfolio
   Single stylesheet. No frameworks, no external fonts, no build step.
   Palette: graphite base, cool slate structure, one restrained gold accent.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg:          #0a0c0f;
  --bg-elev:     #10131a;
  --surface:     #141821;
  --surface-2:   #1a1f2a;
  --line:        #232936;
  --line-strong: #303845;

  /* Ink */
  --ink:         #e9ecf1;
  --ink-med:     #b3bcc9;
  --ink-dim:     #8b95a4;
  /* Lightest ink still passes WCAG AA (4.5:1) for small text on every
     surface used here — the darkest pairing is surface-2 at 4.7:1. */
  --ink-faint:   #808a99;

  /* Accent */
  --gold:        #e3b23c;
  --gold-bright: #f2c65a;
  --gold-dim:    #a8801f;
  --gold-wash:   rgba(227, 178, 60, 0.10);
  --gold-line:   rgba(227, 178, 60, 0.28);

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Metrics */
  --wrap: 1080px;
  --gut: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;
  --header-h: 64px;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  /* Sticky footer: short pages (Contact, 404) still fill the viewport. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; list-style: none; }

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

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

/* ---------- Utility ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* Off-canvas vertically, never horizontally — a negative `left` would widen
   the document and cause horizontal scroll on narrow viewports. */
.skip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 200;
  background: var(--gold);
  color: #0a0c0f;
  padding: 0.7rem 1.1rem;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}
.skip:focus {
  transform: translateY(0);
  color: #0a0c0f;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-line), transparent);
}

.lede {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  color: var(--ink-med);
  max-width: 68ch;
}

.muted { color: var(--ink-dim); }

/* ---------- Header / nav ---------- */

.site-header {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 12, 15, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .mark { color: var(--gold); margin-right: 0.5rem; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-list a {
  display: block;
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-med);
  border-radius: var(--radius);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-list a:hover { color: var(--ink); background: var(--surface); }
.nav-list a[aria-current="page"] { color: var(--gold); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--gold-line); color: var(--gold); }
.nav-toggle .bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle .bar + .bar { margin-top: 4px; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: flex; flex-direction: column; }

  #primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  }
  /* Collapsed by default when JavaScript is available — prevents the menu
     flashing open before the deferred script runs. Without JS the panel stays
     visible so every link remains reachable. */
  .js #primary-nav { display: none; }
  .js .nav-toggle[aria-expanded="true"] + #primary-nav { display: block; }
  #primary-nav[hidden] { display: none; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gut) 1.1rem;
  }
  .nav-list a {
    padding: 0.85rem 0.25rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav-list li:last-child a { border-bottom: 0; }
  .nav-list a:hover { background: transparent; }
}

/* ---------- Sections ---------- */

main { display: block; flex: 1 0 auto; }

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1px solid var(--line);
}
.section:first-child { border-top: 0; }
.section.alt { background: var(--bg-elev); }

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  margin-bottom: 0.75rem;
}

.section-head { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 70% at 12% 0%, rgba(227, 178, 60, 0.07), transparent 62%),
    linear-gradient(180deg, #0d1015 0%, var(--bg) 100%);
  z-index: -1;
}

.hero h1 {
  font-size: clamp(2.25rem, 1.5rem + 4.2vw, 4rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
}

.hero-role {
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.375rem);
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.hero-role .sep { color: var(--gold); margin-inline: 0.55rem; }

.hero-summary {
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.075rem);
  color: var(--ink-med);
  max-width: 62ch;
  margin-bottom: 2rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  margin-bottom: 2rem;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero-meta .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); flex: none;
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
              color 0.18s ease, transform 0.18s ease;
}

.btn-primary {
  background: var(--gold);
  color: #0a0c0f;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: #0a0c0f;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-wash);
  transform: translateY(-1px);
}

.btn svg { flex: none; }

/* Inline text links inside prose */
.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.9rem;
}
.link-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-med);
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
}
.link-list a:hover { color: var(--gold); border-bottom-color: var(--gold-line); }
.link-list svg { flex: none; }

/* ---------- Cards ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.card:hover { border-color: var(--line-strong); background: var(--surface-2); }

/* Angular cut on the top-right corner — the one structural flourish. */
.card--cut {
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
}

.card h3,
.card h2 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.card p { color: var(--ink-dim); font-size: 0.925rem; }
/* Long unbroken tokens (email addresses, URLs) must not push the card wide. */
.card p, .card p a { overflow-wrap: anywhere; }

.card-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.7rem;
}

/* ---------- Timeline (experience) ---------- */

.timeline {
  position: relative;
  padding-left: 1.75rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--gold-line), var(--line) 22%, var(--line));
}

.tl-item { position: relative; padding-bottom: 2.75rem; }
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 9px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
}
.tl-item.is-current::before {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(227, 178, 60, 0.12);
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.15rem;
}

.tl-role {
  font-size: 1.075rem;
  font-weight: 600;
  color: var(--ink);
}

.tl-dates {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.tl-org {
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.85rem;
}
.tl-org .tag {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 0.6rem;
}

.bullets li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink-med);
  font-size: 0.94rem;
  margin-bottom: 0.45rem;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--gold-dim);
}

/* ---------- Tag pills ---------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-med);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}
.tags.tags--gold li { color: var(--gold); border-color: var(--gold-line); background: var(--gold-wash); }

/* ---------- Projects ---------- */

.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.35rem, 3vw, 2rem);
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}
.project:hover { border-color: var(--line-strong); }
.project:last-child { margin-bottom: 0; }

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 1.1rem;
}
.project h3,
.project h2 { font-size: 1.2rem; }

.project-facet {
  margin: 0; /* drop the UA default <dl> margin, which left dead space */
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 0.5rem 1.25rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}
.project-facet dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.28em;
}
.project-facet dd { margin: 0; color: var(--ink-med); }

@media (max-width: 560px) {
  .project-facet { grid-template-columns: 1fr; gap: 0.25rem; }
  .project-facet dd { margin-bottom: 0.35rem; }
}

/* ---------- Skills ---------- */

.skill-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.4rem 1.5rem 1.5rem;
}
.skill-group h3,
.skill-group h2 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.skill-group .count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 0.9rem;
}

/* ---------- Resume page ---------- */

.resume-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-top: 1.75rem;
}
.resume-frame object,
.resume-frame iframe {
  display: block;
  width: 100%;
  height: min(150vh, 1150px);
  border: 0;
  background: #2a2a2a;
}
.resume-fallback {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--ink-dim);
}

@media (max-width: 820px) {
  /* Mobile browsers largely refuse to render embedded PDFs — show the
     summary + buttons instead of a broken grey box. */
  .resume-frame { display: none; }
}

.resume-note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 1.25rem;
}

.resume-summary {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1.75rem;
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.contact-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease,
              transform 0.2s ease;
}
.contact-card:hover {
  border-color: var(--gold-line);
  background: var(--surface-2);
  color: var(--ink);
  transform: translateY(-2px);
}
.contact-card .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}
.contact-card .value {
  font-size: 0.95rem;
  color: var(--ink);
  word-break: break-word;
}

/* ---------- Footer ---------- */

.site-footer {
  flex: none;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  padding-block: 2.5rem;
  margin-top: 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer p {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-block: 4rem;
}
.notfound .code {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 12vw, 6rem);
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ---------- Print ---------- */

@media print {
  .site-header, .site-footer, .actions, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .contact-card:hover { transform: none; }
}

/* ---------- Forced colors ---------- */

@media (forced-colors: active) {
  .card, .project, .skill-group, .contact-card { border: 1px solid CanvasText; }
  .btn { border: 1px solid ButtonText; }
}
