/* ==========================================================================
   Sri Harsha Musunuru — portfolio
   Palette from resistor colour bands: violet (7) = signal, red (2) = fault,
   on a cool datasheet-grey ground.
   ========================================================================== */

:root {
  --paper:      #E6EAEF;
  --card:       #FAFBFC;
  --ink:        #111825;
  --ink-soft:   #2C3644;
  --muted:      #5A6474;
  --rule:       #C4CCD7;
  --rule-soft:  #D8DEE6;
  --signal:     #5B3FC4;
  --signal-dim: #EDE9FA;
  --fault:      #A4123F;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 66ch;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

/* --- type roles ----------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 650;
  line-height: 1.14;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.05em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lede { font-size: 19px; line-height: 1.55; color: var(--ink-soft); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--card); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--rule);
  max-width: 1400px;
  margin: 0 auto;
}

.hero__name {
  font-size: clamp(38px, 7.2vw, 76px);
  font-stretch: 122%;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0 0 18px;
}

.hero__role {
  font-family: var(--mono);
  font-size: clamp(12px, 1.6vw, 14px);
  letter-spacing: 0.06em;
  color: var(--signal);
  margin: 0 0 26px;
  text-transform: uppercase;
  font-weight: 500;
}

.hero__thesis {
  font-size: clamp(20px, 2.7vw, 28px);
  line-height: 1.34;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 500;
  max-width: 24ch;
  margin: 0 0 20px;
}

.hero__sub { max-width: 58ch; color: var(--muted); margin-bottom: 30px; }

.linkrow { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }

.linkrow a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 8px 15px;
  transition: border-color .15s, color .15s, transform .15s;
}
.linkrow a:hover { border-color: var(--signal); color: var(--signal); transform: translateY(-1px); }

/* --- signature: signal trace ---------------------------------------------- */

.trace { margin-top: clamp(40px, 6vw, 64px); border: 1px solid var(--rule); background: var(--card); }

.trace__head {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  justify-content: space-between; align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.trace__head strong { color: var(--ink); font-weight: 500; }
.trace__body { padding: 22px 18px 8px; overflow: hidden; }
.trace svg { display: block; width: 100%; height: auto; }

.trace__label { font-family: var(--mono); font-size: 13px; fill: var(--muted); letter-spacing: 0.06em; }
.trace__annot { font-family: var(--mono); font-size: 12.5px; fill: var(--fault); }
.trace__annot--calm { fill: var(--muted); }

.wave { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.wave--ok { stroke: var(--signal); }
.wave--fault { stroke: var(--fault); }
.marker { stroke: var(--fault); stroke-width: 1.25; stroke-dasharray: 3 4; }
.rail-line { stroke: var(--rule-soft); stroke-width: 1; }

.trace__caption { padding: 6px 18px 18px; font-size: 14px; color: var(--muted); max-width: 74ch; }

@media (prefers-reduced-motion: no-preference) {
  .wave--ok { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 2.1s cubic-bezier(.2,.7,.3,1) .35s forwards; }
  .wave--fault { opacity: 0; animation: appear .5s ease 2.35s forwards; }
  .marker, .trace__annot { opacity: 0; animation: appear .5s ease 2.5s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: 1; } }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.layout { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1fr; }

.rail { display: none; }

@media (min-width: 1040px) {
  .layout { grid-template-columns: 186px minmax(0, 1fr); gap: 56px; }
  .rail {
    display: block; position: sticky; top: 0; align-self: start;
    height: 100vh; padding: 56px 0 40px;
    border-right: 1px solid var(--rule); margin-right: -1px;
  }
}

.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { margin-bottom: 2px; }
.rail a {
  display: block;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  color: var(--muted); text-decoration: none;
  padding: 6px 12px;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.rail a:hover { color: var(--ink); }
.rail a.is-current { color: var(--signal); border-left-color: var(--signal); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: clamp(56px, 8vw, 92px) 0; border-bottom: 1px solid var(--rule); }
.section__title { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 12px; }
.section__intro { color: var(--ink-soft); margin-top: 14px; }

/* --- areas of work grid ---------------------------------------------------- */

.areas { display: grid; gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule); margin-top: 34px; }
@media (min-width: 780px) { .areas { grid-template-columns: 1fr 1fr; } }

.areas > article { background: var(--card); padding: 26px 26px 28px; }
.areas h3 { font-size: 17.5px; font-stretch: 112%; font-weight: 620; margin-bottom: 9px; }
.areas p { font-size: 15px; color: var(--ink-soft); margin: 0; max-width: none; }
.areas .tags {
  display: block; margin-top: 12px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted);
}

/* --- projects -------------------------------------------------------------- */

.project { border-top: 1px solid var(--rule); padding-top: 34px; margin-top: 52px; }
.project:first-of-type { border-top: 0; margin-top: 34px; padding-top: 0; }

.project__meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.project__meta .live { color: var(--signal); }

.project__title { font-size: clamp(22px, 3vw, 30px); margin-bottom: 16px; }

.project__hook {
  font-size: 17.5px; line-height: 1.5; color: var(--ink-soft);
  border-left: 2px solid var(--signal); padding-left: 18px;
  margin: 0 0 28px; max-width: 60ch;
}

.project h4 {
  font-family: var(--mono); font-stretch: normal;
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 30px 0 12px;
}

.owned { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.owned li { border-top: 1px solid var(--rule-soft); padding: 13px 0; font-size: 15.5px; color: var(--ink-soft); }
.owned li strong { color: var(--ink); font-weight: 600; }

/* --- annotated (body + margin note) ---------------------------------------- */

.annotated { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 30px; }
@media (min-width: 900px) { .annotated { grid-template-columns: minmax(0, 1fr) 236px; gap: 40px; align-items: start; } }

.note { border-top: 2px solid var(--ink); padding-top: 12px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.note p { max-width: none; }
.note__label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); display: block; margin-bottom: 8px;
}

/* --- callout --------------------------------------------------------------- */

.callout {
  border: 1px solid var(--rule); border-left: 3px solid var(--fault);
  background: var(--card); padding: 22px 24px; margin: 30px 0; max-width: var(--measure);
}
.callout .eyebrow { color: var(--fault); margin-bottom: 10px; }
.callout p { font-size: 15.5px; }

/* --- problem cards --------------------------------------------------------- */

.problems { display: grid; gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule); margin-top: 34px; }
@media (min-width: 820px) { .problems { grid-template-columns: 1fr 1fr; } }
.problems > article { background: var(--card); padding: 26px; }
.problems h3 { font-size: 17px; font-stretch: 112%; font-weight: 620; margin-bottom: 10px; }
.problems p { font-size: 15px; color: var(--ink-soft); max-width: none; }
.problems .takeaway {
  display: block; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--rule-soft);
  font-size: 14px; color: var(--muted);
}

/* --- skills ---------------------------------------------------------------- */

.skills { display: grid; gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule); margin-top: 30px; }
@media (min-width: 760px) { .skills { grid-template-columns: 1fr 1fr; } }
.skills > div { background: var(--card); padding: 20px 22px; }
.skills h3 {
  font-family: var(--mono); font-stretch: normal;
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--signal); margin-bottom: 10px;
}
.skills p { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0; max-width: none; }

/* --- side projects --------------------------------------------------------- */

.builds { border: 1px solid var(--rule); background: var(--card); margin-top: 30px; }
.builds article { display: grid; gap: 4px; padding: 18px 22px; border-bottom: 1px solid var(--rule-soft); }
.builds article:last-child { border-bottom: 0; }
@media (min-width: 820px) { .builds article { grid-template-columns: 210px minmax(0, 1fr) 116px; gap: 24px; align-items: baseline; } }
.builds h3 { font-size: 16px; font-stretch: 112%; font-weight: 600; }
.builds p { font-size: 14.5px; color: var(--ink-soft); margin: 0; max-width: none; }
.builds .stack { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.status { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--rule); margin-right: 7px; vertical-align: middle; }
.status--working::before { background: var(--signal); }
.status--wip::before { background: var(--fault); }

/* --- plain lists ----------------------------------------------------------- */

.plainlist { list-style: none; padding: 0; margin: 26px 0 0; max-width: var(--measure); }
.plainlist li { border-top: 1px solid var(--rule-soft); padding: 14px 0; }
.plainlist strong { font-weight: 600; }
.plainlist span { display: block; color: var(--muted); font-size: 14.5px; }

/* --- contact --------------------------------------------------------------- */

.contact { padding: clamp(56px, 8vw, 92px) 0 clamp(48px, 7vw, 80px); }
.contact h2 { font-size: clamp(28px, 4.2vw, 44px); margin-bottom: 18px; max-width: 19ch; }

footer {
  border-top: 1px solid var(--rule);
  padding: 24px var(--gutter) 40px;
  max-width: 1400px; margin: 0 auto;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}
