/* =========================================================================
   Javier F. Salinas — personal brand
   Light · warm · premium executive design system (vanilla CSS)
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* surfaces */
  --bg:          #FCFBF8;   /* warm ivory */
  --surface:     #FFFFFF;   /* white sections / cards */
  --surface-2:   #FBFAF7;   /* faint ivory for nested fills */

  /* lines */
  --line:        #E8E8E8;
  --line-soft:   #EFEEEA;

  /* type */
  --text:        #161616;   /* charcoal */
  --text-dim:    #5E6470;   /* slate */
  --text-faint:  #6B7280;   /* slate — meets WCAG AA (~4.7:1) on ivory/white for small labels */

  /* accent */
  --accent:      #0F766E;   /* deep emerald */
  --accent-hover:#14B8A6;   /* bright emerald */
  --accent-soft: rgba(15, 118, 110, 0.07);
  --accent-line: rgba(15, 118, 110, 0.22);

  /* type families */
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif; /* premium substitute for Satoshi */
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* metrics */
  --wrap:   1080px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-btn: 11px;
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);

  /* shadows — soft and light, never heavy */
  --shadow-sm: 0 1px 2px rgba(22, 22, 22, 0.04);
  --shadow:    0 1px 2px rgba(22, 22, 22, 0.04), 0 10px 30px -16px rgba(22, 22, 22, 0.12);
  --shadow-lg: 0 1px 3px rgba(22, 22, 22, 0.05), 0 24px 60px -28px rgba(22, 22, 22, 0.18);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
strong { color: var(--text); font-weight: 600; }
em { font-style: italic; }
img { max-width: 100%; display: block; }

/* label / eyebrow style (formerly mono) — refined tracked Inter */
.mono {
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-feature-settings: "tnum" 1;
}
.dim  { color: var(--text-dim); }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 200;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

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

::selection { background: var(--accent-soft); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.85em 1.5em;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.97rem; font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #DADAD6; }
.btn .arr { transition: transform 0.25s var(--ease); }
.btn:hover .arr { transform: translate(2px, -2px); }

.btn-solid {
  background: var(--accent); color: #fff;
  border-color: transparent; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15,118,110,0.20), 0 8px 22px -12px rgba(15,118,110,0.55);
}
.btn-solid:hover { background: var(--accent-hover); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(20,184,166,0.28), 0 14px 30px -12px rgba(20,184,166,0.5); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }

/* =========================================================================
   Header
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.topbar.is-scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 94%, #fff 6%); box-shadow: 0 1px 0 rgba(22,22,22,0.02); }

.topbar-inner {
  width: min(var(--wrap), 100% - 48px); margin-inline: auto;
  height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; color: var(--text); }
.brand-mark { color: var(--accent); font-family: Georgia, serif; font-size: 1.2em; line-height: 1; }

.topnav { display: flex; align-items: center; gap: 2px; }
.topnav > a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.94rem; font-weight: 500; color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.topnav > a:not(.top-cta):hover { color: var(--text); }
.topnav > a.is-current { color: var(--text); }
.topnav > a.is-current::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.top-cta {
  margin-left: 10px;
  border: 1px solid transparent;
  color: #fff !important;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(15,118,110,0.2), 0 8px 20px -12px rgba(15,118,110,0.5);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.top-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  box-shadow: var(--shadow-sm);
}
.nav-toggle span { display: block; width: 19px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.scroll-progress { height: 2px; width: 0%; background: var(--accent); transition: width 0.1s linear; }

/* =========================================================================
   Hero
   ========================================================================= */
.hero { position: relative; padding: clamp(72px, 12vw, 150px) 0 clamp(56px, 8vw, 96px); }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.65em;
  font-size: 0.82rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.13em;
  font-weight: 600;
  margin-bottom: 30px;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 2.6s ease-out infinite; }
@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  70%  { transform: scale(3.4); opacity: 0; }
  100% { opacity: 0; }
}

.hero-name {
  font-size: clamp(2.85rem, 7vw, 4.6rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.0;
  margin-bottom: 30px;
  max-width: 16ch;
}
.hero-dot { color: var(--accent); }

.hero-thesis {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.7vw, 1.9rem);
  font-weight: 500; line-height: 1.32; letter-spacing: -0.018em;
  color: var(--text);
  max-width: 24ch; margin-bottom: 28px;
}
.hero-thesis .dim { color: var(--text-dim); font-weight: 500; }

.hero-intro { max-width: 60ch; color: var(--text-dim); font-size: 1.08rem; line-height: 1.75; margin-bottom: 38px; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 12px 30px;
  font-size: 0.86rem; color: var(--text-dim); font-weight: 500;
  padding: 22px 0; margin-bottom: 36px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.55em; }
.hero-meta i { color: var(--accent); font-style: normal; font-size: 0.62em; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* =========================================================================
   Stats band
   ========================================================================= */
.stats-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 44px 24px 44px 0; border-right: 1px solid var(--line-soft); }
.stat:last-child { border-right: none; }
.stat-num {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 4.6vw, 3.1rem); line-height: 1; letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 12px;
}
.stat-label { display: block; font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; max-width: 22ch; font-weight: 500; }

/* =========================================================================
   Section shell
   ========================================================================= */
.section { padding: clamp(72px, 10vw, 144px) 0; position: relative; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: clamp(44px, 5.5vw, 72px); }
.section-idx { display: inline-block; font-size: 0.82rem; color: var(--accent); letter-spacing: 0.1em; font-weight: 600; margin-bottom: 18px; }
.section-title { font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -0.03em; font-weight: 800; margin-bottom: 22px; }
.section-intro { color: var(--text-dim); font-size: 1.1rem; line-height: 1.7; }

.sub-label {
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--text-faint); font-weight: 600; margin: 34px 0 18px;
}
.sub-label:first-child { margin-top: 0; }

/* ---------- Tags / capabilities ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem; color: var(--text-dim); font-weight: 500;
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2);
}
.caps { display: flex; flex-wrap: wrap; gap: 10px; }
.cap {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-size: 0.9rem; color: var(--text); font-weight: 500;
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cap::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.cap:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }

/* =========================================================================
   Card primitive
   ========================================================================= */
.venture, .proj, .skill-group, .acc, .contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* =========================================================================
   Ventures
   ========================================================================= */
.ventures { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.venture {
  padding: 34px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.venture:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #DEDEDA; }
.venture.lead { grid-column: 1 / -1; }
.venture.lead .v-desc { max-width: 66ch; }

.v-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.v-name { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.025em; font-weight: 700; }
.v-role { font-size: 0.8rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin-bottom: 18px; }
.v-desc { color: var(--text-dim); margin-bottom: 24px; line-height: 1.7; }
.v-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.v-link { display: inline-flex; align-items: center; gap: 0.4em; color: var(--accent); font-weight: 600; font-size: 0.94rem; transition: color 0.2s var(--ease); }
.v-link:hover { color: var(--accent-hover); }
.v-link .arr { transition: transform 0.2s var(--ease); }
.v-link:hover .arr { transform: translate(2px, -2px); }

.pill { display: inline-flex; align-items: center; gap: 0.5em; font-size: 0.74rem; padding: 4px 11px; border-radius: 999px; letter-spacing: 0.02em; font-weight: 600; }
.pill-live { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.pill-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pill-year { color: var(--text-faint); border: 1px solid var(--line); font-weight: 500; }

/* =========================================================================
   Experience timeline
   ========================================================================= */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item {
  position: relative;
  display: grid; grid-template-columns: 170px 1fr; gap: 32px;
  padding: 30px 0 30px 32px;
  border-bottom: 1px solid var(--line-soft);
}
.tl-item:last-child { border-bottom: none; }
.tl-item::before {
  content: ""; position: absolute; left: -4px; top: 38px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  transition: background 0.3s var(--ease);
}
.tl-item:hover::before { background: var(--accent); }
.tl-when { color: var(--accent); font-size: 0.86rem; font-weight: 600; padding-top: 3px; letter-spacing: 0.01em; }
.tl-role { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.tl-org { color: var(--text-faint); font-weight: 500; font-size: 0.94rem; font-family: var(--font-body); }
.tl-body p { color: var(--text-dim); font-size: 1.0rem; line-height: 1.7; }

/* =========================================================================
   Implementations — toolbar, filters, accordion
   ========================================================================= */
.impl-toolbar {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 26px; border-bottom: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font-family: var(--font-body);
  font-size: 0.86rem; color: var(--text-dim); font-weight: 500;
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.filter:hover { color: var(--text); border-color: #DADAD6; }
.filter.is-active { color: #fff; background: var(--accent); border-color: transparent; font-weight: 600; }
.filter-count { opacity: 0.6; margin-left: 3px; font-variant-numeric: tabular-nums; }
.filter.is-active .filter-count { opacity: 0.8; }

.acc-actions { display: flex; gap: 8px; }
.acc-btn {
  font-family: var(--font-body); font-size: 0.82rem; color: var(--text-dim); font-weight: 500;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.acc-btn:hover { color: var(--text); border-color: #DADAD6; }

.acc-group { margin-bottom: 48px; }
.acc-group[hidden] { display: none; }
.acc-group.is-dimmed { display: none; }
.acc-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--accent); font-weight: 600; margin-bottom: 18px; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.acc {
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.acc[open] { border-color: var(--accent-line); grid-column: 1 / -1; box-shadow: var(--shadow-lg); }
.acc:hover:not([open]) { border-color: #DEDEDA; transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.acc summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: flex-start; gap: 16px; justify-content: space-between;
  padding: 24px 26px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.acc-line { font-size: 0.94rem; color: var(--text-dim); line-height: 1.6; }

.acc-plus { position: relative; flex: none; width: 22px; height: 22px; margin-top: 3px; }
.acc-plus::before, .acc-plus::after {
  content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--accent); border-radius: 2px;
}
.acc-plus::before { width: 13px; height: 2px; }
.acc-plus::after  { width: 2px; height: 13px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.acc[open] .acc-plus::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }

.acc-body { padding: 0 26px 28px; border-top: 1px solid var(--line-soft); }
.acc[open] .acc-body { animation: accReveal 0.4s var(--ease) both; }
@keyframes accReveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.acc-block { padding-top: 22px; }
.acc-h { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--text-faint); font-weight: 600; margin-bottom: 8px; }
.acc-block p { color: var(--text-dim); font-size: 0.98rem; line-height: 1.7; }
.acc-block .tags { margin-top: 4px; }
.acc-impact {
  margin-top: 24px; padding: 18px 20px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.98rem; line-height: 1.65;
}
.impact-tag { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--accent); font-weight: 700; margin-bottom: 7px; }
.acc-date { margin-top: 16px; font-size: 0.8rem; color: var(--text-faint); font-weight: 500; }

/* =========================================================================
   AI builds — project grid
   ========================================================================= */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.proj {
  padding: 30px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.proj:hover { border-color: #DEDEDA; transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.proj-idx { font-size: 0.76rem; color: var(--accent); letter-spacing: 0.08em; font-weight: 600; margin-bottom: 16px; }
.proj-name { font-size: 1.24rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; line-height: 1.25; }
.proj-desc { color: var(--text-dim); font-size: 0.98rem; line-height: 1.7; margin-bottom: 18px; }
.proj-how {
  font-size: 0.88rem; color: var(--text-dim); line-height: 1.6;
  padding: 14px 16px; border-left: 2px solid var(--accent-line);
  background: var(--surface-2); border-radius: 0 10px 10px 0; margin-bottom: 20px;
}
.proj-how .mono { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; margin-bottom: 5px; }

/* =========================================================================
   Education & awards + skills
   ========================================================================= */
.edu-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; }
.rec-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.rec {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 0; border-bottom: 1px solid var(--line-soft);
}
.rec:last-child { border-bottom: none; }
.rec-mark { color: var(--accent); font-size: 0.82rem; flex: none; }
.rec-award .rec-mark { color: var(--accent); }
.rec-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.rec-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.rec-sub { color: var(--text-dim); font-size: 0.94rem; }
.rec-meta { font-size: 0.76rem; color: var(--text-faint); font-weight: 600; border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; flex: none; }

.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; align-items: start; }
.skill-group { padding: 30px; }
.skill-group .sub-label { margin-top: 0; }

/* =========================================================================
   Contact
   ========================================================================= */
.contact { padding-bottom: clamp(88px, 12vw, 160px); }
.contact-card {
  position: relative;
  padding: clamp(44px, 6vw, 80px);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.contact-card::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  background: var(--accent-soft); border-radius: 50%; filter: blur(10px); pointer-events: none;
}
.contact-card > * { position: relative; }
.contact .section-idx { margin-bottom: 20px; }
.contact-title { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; line-height: 1.08; font-weight: 800; max-width: 18ch; margin-bottom: 24px; }
.contact-title em { color: var(--accent); font-style: normal; }
.contact-copy { color: var(--text-dim); font-size: 1.12rem; line-height: 1.7; max-width: 56ch; margin-bottom: 36px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-foot { border-top: 1px solid var(--line); padding: 44px 0; background: var(--bg); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-display); font-weight: 700; color: var(--text); }
.foot-brand .brand-mark { color: var(--accent); font-family: Georgia, serif; }
.foot-links { display: flex; gap: 22px; }
.foot-links a { color: var(--text-dim); font-size: 0.92rem; font-weight: 500; transition: color 0.2s var(--ease); }
.foot-links a:hover { color: var(--accent); }
.foot-meta { color: var(--text-faint); font-size: 0.82rem; margin-left: auto; }
.totop { color: var(--text-dim); font-size: 0.84rem; font-weight: 500; border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; background: var(--surface); transition: color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.totop:hover { color: var(--text); border-color: #DADAD6; box-shadow: var(--shadow-sm); }

/* =========================================================================
   Reveal animation — fade + soft upward motion
   ========================================================================= */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1024px) {
  .topnav {
    position: fixed; inset: 76px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 24px 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  }
  .topnav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .topnav > a { padding: 14px 12px; font-size: 1rem; border-radius: 10px; }
  .topnav > a.is-current::after { display: none; }
  .topnav > a.is-current { background: var(--accent-soft); color: var(--accent); }
  .top-cta { margin-left: 0; margin-top: 8px; justify-content: center; }
  .nav-toggle { display: flex; }
}

@media (max-width: 880px) {
  .ventures { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: 1fr; }
  .acc[open] { grid-column: auto; }
  .proj-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; gap: 18px; }
  .edu-layout { grid-template-columns: 1fr; gap: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat { border-bottom: 1px solid var(--line-soft); }
  .stat:nth-last-child(-n+2) { padding-bottom: 36px; border-bottom: none; }
  .stat:nth-child(1), .stat:nth-child(2) { padding-top: 36px; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap, .topbar-inner { width: min(var(--wrap), 100% - 36px); }
  html { scroll-padding-top: 84px; }
  .topbar-inner { height: 66px; }
  .topnav { inset: 66px 0 auto 0; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; padding-left: 26px; }
  .tl-item::before { top: 32px; }
  .tl-when { padding-top: 0; }
  .impl-toolbar { flex-direction: column; align-items: stretch; }
  .acc-actions { justify-content: flex-end; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--line-soft); padding: 28px 0; }
  .stat:last-child { border-bottom: none; }
  .stat:nth-child(1) { padding-top: 0; }
  .hero-meta { gap: 12px 20px; }
  .venture, .proj, .skill-group { padding: 26px; }
  .acc summary { padding: 20px; }
  .acc-body { padding: 0 20px 24px; }
}

/* =========================================================================
   Motion / contrast preferences
   ========================================================================= */
@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; }
  .js .reveal { opacity: 1; transform: none; }
}
