/* Portfolio for Manyashree M. K.
   Layout: a fixed WebGL scene (a 21-landmark hand) sits behind one scrolling column of glass panels.
   Hero copy stays on the left so the hand reads on the right; scrolling turns it and moves it across the page.
   One committed dark look: cool near-black ground, ice-blue bones, coral fingertips and accents. */
:root {
  --bg: #07090e;
  --surface: rgba(13, 18, 27, 0.74);
  --line: #1f2a3a;
  --fg: #e9eef6;
  --muted: #8e9bb0;
  --accent: #ff7a59;
  --ice: #8fb8ff;

  --font-display: "Syne", "Helvetica Neue", Arial, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --text: 1.0625rem;
  --small: 0.9rem;
  --label: 0.74rem;
  --h3: 1.25rem;
  --h2: clamp(1.8rem, 4.2vw, 2.7rem);
  --h1: clamp(3.2rem, 10vw, 7rem);

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text);
  line-height: 1.65;
  padding-block: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
}

/* Keeps scrolled content from showing above the sticky header on phones with a notch. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}

/* ---------- Background layers ---------- */
.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% 10%, rgba(143, 184, 255, 0.10), transparent 60%),
    radial-gradient(40rem 30rem at 0% 90%, rgba(255, 122, 89, 0.07), transparent 60%);
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.no-webgl #scene,
.no-webgl .hud,
.no-webgl .hand-note { display: none; }

.hud {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  font-family: var(--font-mono);
  font-size: var(--label);
  letter-spacing: 0.06em;
  color: var(--muted);
  pointer-events: none;
}
.hud b { color: var(--ice); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin-inline: auto;
}

section { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.hero { padding-block: clamp(3rem, 10vw, 7rem) clamp(3rem, 8vw, 5rem); max-width: 40rem; }

.section-head { margin-bottom: 1.75rem; }
.section-head h2 { margin-bottom: 0; }

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  max-width: 72rem;
  margin-inline: auto;
  padding-block: 0.8rem;
  background: rgba(7, 9, 14, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.top nav a {
  font-family: var(--font-mono);
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.top nav a:hover { color: var(--fg); border-color: var(--accent); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--h1); }
h1 span { display: block; }
h1 .accent { color: var(--accent); }
h2 { font-size: var(--h2); margin-bottom: 1rem; }
h3 { font-size: var(--h3); line-height: 1.2; margin-bottom: 0.35rem; }

p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.eyebrow, .label, .kind {
  font-family: var(--font-mono);
  font-size: var(--label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.eyebrow { color: var(--ice); }
.kind { letter-spacing: 0.08em; margin-bottom: 0.9rem; }

.lead {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  max-width: 34rem;
  margin: 1.5rem 0 1.75rem;
}
.prose { max-width: 65ch; }

.hand-note {
  margin: 2rem 0 0;
  max-width: 30rem;
  font-size: var(--small);
  color: var(--muted);
}

/* ---------- Buttons and links ---------- */
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  font: 500 0.95rem var(--font-body);
  color: var(--fg);
  background: rgba(13, 18, 27, 0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ice); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0c12; font-weight: 700; }
.btn.primary:hover { border-color: var(--fg); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Panels ---------- */
.panel {
  min-width: 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}
.about-grid > * { min-width: 0; }

.facts { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; margin: 1.25rem 0 0; }
.facts div { min-width: 0; }
.facts dt { font-family: var(--font-mono); font-size: var(--label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.project { display: flex; flex-direction: column; }
.project.featured { grid-column: span 2; }
.project p { font-size: 1rem; }
.project .foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; padding-top: 0.5rem; }

.tilt {
  position: relative;
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.18s ease-out, border-color 0.2s;
  will-change: transform;
}
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(143, 184, 255, 0.14), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.tilt:hover { border-color: #33445e; }
.tilt:hover::after { opacity: 1; }

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.75rem;
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
}
.metrics b { color: var(--fg); font-weight: 500; font-size: 1.15rem; margin-right: 0.3rem; font-variant-numeric: tabular-nums; }

/* ---------- Chips and lists ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.chips li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(143, 184, 255, 0.06);
}

.skills { padding-block: 0.5rem; }
.skill-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.5rem 1.5rem;
  align-items: start;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.skill-row:last-child { border-bottom: 0; }
.skill-row .label { margin: 0.35rem 0 0; }
.skill-row > * { min-width: 0; }

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.status { margin: 0.5rem 0 1rem; }

.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.plain li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }
.plain .muted { font-family: var(--font-mono); font-size: 0.78rem; }

/* ---------- Contact ---------- */
.contact { padding: clamp(1.5rem, 5vw, 3rem); }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin: 1.5rem 0; }
.address {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  overflow-wrap: anywhere;
  user-select: all;
}
.copy-status { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); min-height: 1em; }

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 2rem 3.5rem;
  font-family: var(--font-mono);
  font-size: var(--label);
  letter-spacing: 0.06em;
  color: var(--muted);
}
.foot-bar p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 999px) {
  .project-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 899px) {
  #scene { opacity: 0.5; }
  .hud { display: none; }
  .about-grid, .two-col { grid-template-columns: 1fr; }
  .hero { max-width: none; }
}

@media (max-width: 679px) {
  .project-grid { grid-template-columns: 1fr; }
  .project.featured { grid-column: auto; }
  .skill-row { grid-template-columns: 1fr; }
  .skill-row .label { margin-top: 0; }
  .panel { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tilt { transform: none; }
}
