/* ==========================================================================
   Amlendu Shekhar — portfolio
   A single neutral palette: warm stone. Not a light theme, not a dark one.
   ========================================================================== */

:root {
  /* Surfaces, from recessed to raised */
  --stone-900: #22211d;
  --stone-800: #34332d;
  --stone-700: #4a483f;
  --stone-600: #6b6859;
  --stone-400: #a9a497;
  --stone-300: #c3bfb3;
  --stone-250: #ccc8bc;
  --stone-200: #d4d0c4;
  --stone-150: #dcd8cd;
  --stone-100: #e4e1d8;

  --canvas: var(--stone-200);
  --panel: var(--stone-150);
  --panel-raised: var(--stone-100);
  --sunken: var(--stone-250);

  --ink: #211f1a;
  --ink-soft: #46433a;
  --ink-mute: #6d6959;

  --line: rgba(34, 33, 29, 0.14);
  --line-strong: rgba(34, 33, 29, 0.26);

  --accent: #2f6a5c;
  --accent-deep: #225046;
  --accent-wash: rgba(47, 106, 92, 0.10);
  --ember: #9a5a2c;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(34, 33, 29, 0.07), 0 2px 6px rgba(34, 33, 29, 0.05);
  --shadow: 0 2px 4px rgba(34, 33, 29, 0.06), 0 10px 26px rgba(34, 33, 29, 0.09);
  --shadow-lg: 0 4px 10px rgba(34, 33, 29, 0.08), 0 22px 50px rgba(34, 33, 29, 0.13);

  --sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --page: 1120px;
  --nav-h: 64px;
}

/* --------------------------------------------------------------- base --- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  background-color: var(--canvas);
  background-image:
    radial-gradient(1100px 620px at 12% -10%, rgba(255, 253, 247, 0.55), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(47, 106, 92, 0.07), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  font-variation-settings: "SOFT" 0, "WONK" 0;
}

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

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

img { max-width: 100%; display: block; }

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--panel-raised);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: top 0.18s ease;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ layout --- */

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

.section {
  padding-block: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line);
}
.section:first-of-type { border-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--accent);
  opacity: 0.6;
  flex: none;
}

.section-head h2 {
  font-size: clamp(27px, 4.1vw, 38px);
  margin: 0;
}

/* A section heading standing on its own, with no eyebrow above it: it keeps
   the accent rule so the section still has the same anchor as the others. */
.section-head h2.h2-rule {
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-head h2.h2-rule::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  opacity: 0.6;
  flex: none;
}

.section-note {
  color: var(--ink-mute);
  font-size: 15px;
  max-width: 46ch;
  margin: 0;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav[data-stuck="true"] {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 20px rgba(34, 33, 29, 0.06);
}

.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  flex: none;
  transition: color 0.16s ease;
}
.brand:hover { color: var(--accent-deep); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  display: block;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-links a:hover { background: rgba(34, 33, 29, 0.06); color: var(--ink); }
.nav-links a[aria-current="true"] {
  color: var(--accent-deep);
  background: var(--accent-wash);
}

.nav-cta { flex: none; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-raised);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 17px; height: 1.6px;
  background: currentColor;
  position: relative;
  transition: transform 0.2s ease, background 0.1s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 17px; height: 1.6px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after { top: 5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* --------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary {
  background: var(--accent-deep);
  color: #f2efe6;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent); color: #f7f5ee; box-shadow: var(--shadow); }

.btn-ghost {
  background: var(--panel-raised);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: #ebe8e0; border-color: rgba(34,33,29,.34); color: var(--ink); }

.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn-quiet:hover { background: rgba(34, 33, 29, 0.05); color: var(--ink); }

.btn-sm { padding: 7px 13px; font-size: 13.5px; }

/* --------------------------------------------------------------- hero --- */

.hero { padding-block: clamp(46px, 7vw, 86px) clamp(40px, 6vw, 72px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 11px;
  border-radius: 999px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 0 rgba(47, 106, 92, 0.45);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(47, 106, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 106, 92, 0); }
}

.hero h1 {
  font-size: clamp(40px, 7vw, 66px);
  line-height: 1.06;
  letter-spacing: -0.028em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.hero-lede {
  font-size: clamp(16.5px, 2.1vw, 19px);
  color: var(--ink-soft);
  max-width: 54ch;
  margin-bottom: 14px;
}
.hero-sub {
  color: var(--ink-mute);
  font-size: 15.5px;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--ink-mute);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 14px; height: 14px; opacity: 0.75; }

.portrait-frame {
  position: relative;
  width: clamp(190px, 25vw, 260px);
  aspect-ratio: 1;
  flex: none;
  justify-self: end;
}
.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  filter: saturate(0.92) contrast(1.02);
}
.portrait-frame::after {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px dashed rgba(34, 33, 29, 0.2);
  animation: spin 70s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- stats --- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(40px, 6vw, 64px);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat {
  background: var(--panel);
  padding: 20px 20px 18px;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.stat span {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.4;
}

/* -------------------------------------------------------------- about --- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}
.about-body p { font-size: 16.5px; }
.about-body p + p { margin-top: 0.1em; }

.facts {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 20px;
  box-shadow: var(--shadow-sm);
}
.facts div {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.facts div:last-child { border-bottom: 0; }
.facts dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
  flex: none;
}
.facts dd { margin: 0; color: var(--ink); text-align: right; font-weight: 500; }
.facts dd a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }

/* --------------------------------------------------------- experience --- */

.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(var(--line-strong), var(--line));
}

.job {
  position: relative;
  padding-left: 36px;
  padding-bottom: 36px;
}
.job:last-child { padding-bottom: 0; }
.job::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--panel-raised);
  border: 2px solid var(--stone-400);
  box-shadow: 0 0 0 4px var(--canvas);
}
.job[data-now="true"]::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--canvas), 0 0 0 7px var(--accent-wash);
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 4px;
}
.job-head h3 { font-size: 20px; margin: 0; }
.job-org {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 550;
}
.job-org::before { content: "· "; color: var(--stone-400); }
.job-when {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  white-space: nowrap;
}
.job-place { font-size: 13.5px; color: var(--ink-mute); margin-bottom: 12px; }

.job ul.bullets { margin-bottom: 14px; }
.bullets li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 7px;
  font-size: 15.5px;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--stone-400);
}
.bullets li:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- tags --- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  padding: 3.5px 9px;
  border-radius: 6px;
  background: var(--sunken);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag-accent {
  background: var(--accent-wash);
  border-color: rgba(47, 106, 92, 0.24);
  color: var(--accent-deep);
}

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

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.card-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 12px;
}
.card-flag::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.card h3 {
  font-size: 22px;
  margin: 0 0 3px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.card-sub {
  font-size: 13px;
  color: var(--ink-mute);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}
.card p { font-size: 15.3px; color: var(--ink-soft); }
.card .tags { margin-top: 16px; }

.card-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.figure-chip {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  line-height: 1.25;
  min-width: 64px;
}
.figure-chip b {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}
.figure-chip span { font-size: 11px; color: var(--ink-mute); }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

/* The flagship card runs the full width of the grid and splits in two. */
.card-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px clamp(28px, 4vw, 48px);
  align-items: start;
}
.card-featured .feat-main { min-width: 0; }
.card-featured .feat-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}
.card-featured .card-figures,
.card-featured .tags,
.card-featured .card-links { margin-top: 0; padding-top: 0; }
.card-featured .card-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.card-featured .figure-chip { min-width: 0; }
@media (max-width: 420px) {
  .card-featured .card-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1040px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-wide { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .card-featured { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .card-featured .feat-side { padding-top: 0; }
}
@media (max-width: 680px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
}

/* archive */

.archive {
  margin-top: 26px;
}
.archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.archive-toggle svg { transition: transform 0.22s ease; }
.archive-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.archive-panel {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.archive-panel[hidden] { display: none; }

.mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.mini:hover {
  background: var(--panel-raised);
  border-color: var(--line-strong);
  transform: translateY(-2px);
  color: inherit;
}
.mini strong {
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mini strong svg { width: 14px; height: 14px; opacity: 0.45; flex: none; }
.mini span { font-size: 13.8px; color: var(--ink-mute); line-height: 1.5; }
.mini em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone-600);
}

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

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .skills-grid { grid-template-columns: minmax(0, 1fr); } }
.skill-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 21px;
  box-shadow: var(--shadow-sm);
}
.skill-block h3 {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0 0 14px;
}

/* ----------------------------------------------------------- security --- */

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

.cred {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.cred-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.cred-badge {
  width: 46px; height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.cred-badge svg { width: 24px; height: 24px; }
.cred h3 { margin: 0 0 2px; font-size: 19px; }
.cred-meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em; color: var(--ink-mute); }
.cred p { font-size: 15px; }

.rank-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 10px;
  margin: 16px 0 4px;
}
.rank {
  text-align: center;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 6px;
}
.rank b {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  line-height: 1.1;
}
.rank span { font-size: 11px; color: var(--ink-mute); }

.validation {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-mute);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  word-break: break-all;
}

/* ------------------------------------------------------------ beyond --- */

.beyond-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.beyond {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.beyond h3 {
  font-size: 18px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.beyond h3 svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.beyond p { font-size: 15px; }
.beyond .tags { margin-top: 14px; }

.lang-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.lang-row:last-child { border-bottom: 0; padding-bottom: 0; }
.lang-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.lang-row b { font-weight: 550; color: var(--ink); font-size: 14.5px; }
.lang-row span { color: var(--ink-mute); font-size: 12.5px; text-align: right; }
.meter {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--sunken);
  overflow: hidden;
  border: 1px solid var(--line);
}
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

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

.contact {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
  text-align: center;
}
.contact h2 { font-size: clamp(27px, 4.4vw, 40px); margin-bottom: 12px; }
.contact p { max-width: 50ch; margin-inline: auto; color: var(--ink-soft); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}

.copy-btn { position: relative; }
.copy-btn[data-copied="true"] { color: var(--accent-deep); border-color: var(--accent); }

/* ------------------------------------------------------------- footer --- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 30px 40px;
  font-size: 13.5px;
  color: var(--ink-mute);
}
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  justify-content: space-between;
}
.foot a { color: var(--ink-soft); text-decoration: none; }
.foot a:hover { color: var(--accent-deep); text-decoration: underline; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------ motion --- */

/* Only hidden once JS has confirmed it can reveal them again. */
.js-anim .reveal {
  opacity: 0;
  transform: translateY(14px);
}
.js-anim .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s cubic-bezier(.22,.61,.36,1), transform 0.6s cubic-bezier(.22,.61,.36,1);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-anim .reveal, .js-anim .reveal.in { opacity: 1; transform: none; transition: none; }
  .portrait-frame::after { animation: none; }
  .pulse { animation: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ----------------------------------------------------------- responsive - */

@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  :root { --nav-h: 60px; }

  .nav-toggle { display: inline-flex; }
  .nav-cta { display: none; }

  .nav-links {
    position: absolute;
    left: 14px; right: 14px;
    top: calc(var(--nav-h) + 6px);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: var(--panel-raised);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }
  .nav-links[hidden] { display: none; }

  /* Without JS there is nothing to open the menu with, so lay the links
     out inline instead of leaving the panel hanging open. */
  html:not(.js) .nav-inner { height: auto; flex-wrap: wrap; padding-block: 10px; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-links {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  html:not(.js) .nav-links a { padding: 6px 10px; font-size: 14px; }
  html:not(.js) .nav-links .nav-resume { background: none; color: var(--accent-deep); }
  .nav-links a { padding: 11px 14px; border-radius: 10px; font-size: 15.5px; }
  .nav-links .nav-resume {
    margin-top: 6px;
    text-align: center;
    background: var(--accent-deep);
    color: #f2efe6;
  }
  .nav-links .nav-resume:hover { background: var(--accent); color: #f7f5ee; }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }
  .portrait-frame {
    order: -1;
    justify-self: start;
    width: clamp(132px, 34vw, 164px);
  }
  .portrait-frame::after { inset: -11px; }

  .job-when { margin-left: 0; width: 100%; order: 3; }
}

@media (max-width: 600px) {
  .rank-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 18px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .cred { padding: 20px; }
  .foot-inner { justify-content: flex-start; }
}

/* ------------------------------------------------------------- print --- */

@media print {
  body { background: #fff; color: #000; }
  .nav, .hero-actions, .contact-actions, .archive-toggle, .portrait-frame::after { display: none; }
  .section { page-break-inside: avoid; border-top: 1px solid #ccc; }
  .card, .cred, .skill-block, .beyond, .facts { box-shadow: none; border: 1px solid #ccc; }
  .archive-panel[hidden] { display: grid !important; }
}
