/* ==========================================================================
   ramytamer.com styles.css
   Tokens mirror DESIGN.md. Emphasis carried by luminance/weight/size, never
   hue alone (site owner is red-green colorblind). Edit a token, whole site updates.
   ========================================================================== */

/* ---- Fonts (self-hosted) ----
   Bricolage Grotesque (display) · Hanken Grotesk (body) · Sometype Mono (accents) */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/bricolage-600.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/bricolage-700.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/hanken-400.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("/assets/fonts/hanken-600.woff2") format("woff2");
}
@font-face {
  font-family: "Sometype Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/sometype-400.woff2") format("woff2");
}
@font-face {
  font-family: "Sometype Mono";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/sometype-500.woff2") format("woff2");
}

/* ---- Tokens ---- */
:root {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Hanken Grotesk", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Sometype Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-2xs: .72rem;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1.0625rem;
  --fs-md: clamp(1.15rem, 1.05rem + .4vw, 1.3rem);
  --fs-lg: clamp(1.4rem, 1.2rem + .8vw, 1.7rem);
  --fs-xl: clamp(1.75rem, 1.4rem + 1.4vw, 2.3rem);
  --fs-display: clamp(2.5rem, 1.8rem + 3.6vw, 4rem);

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem; --space-16: 4rem;
  --space-24: 6rem; --space-32: 8rem;

  --measure: 68ch;
  --content: 72rem;
  --radius: 10px; --radius-sm: 6px;
  --section-y: clamp(3.5rem, 8vw, 7rem);
  --pad-x: clamp(1.25rem, 5vw, 2.5rem);
  --ease: cubic-bezier(.2, .6, .2, 1);
}

/* Dark (primary) */
:root, :root[data-theme="dark"] {
  --bg: #0f1012;
  --surface: #17181c;
  --surface-2: #1e2025;
  --border: rgba(255, 255, 255, .10);
  --ink: #eceae4;
  --ink-muted: #a4a29b;
  --ink-faint: #8a857b;
  --accent: #e8b04b;
  --accent-strong: #f0bd5e;
  --accent-quiet: rgba(232, 176, 75, .14);
  --on-accent: #171203;
  color-scheme: dark;
}

/* Light */
:root[data-theme="light"] {
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f2efe8;
  --border: rgba(20, 18, 12, .12);
  --ink: #1b1a16;
  --ink-muted: #57544c;
  --ink-faint: #6a675f;
  --accent: #8a5a00;
  --accent-strong: #6f4700;
  --accent-quiet: rgba(138, 90, 0, .10);
  --on-accent: #fffaf0;
  color-scheme: light;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .2s var(--ease), color .2s var(--ease);
}
img, picture, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }

/* Light ink on dark surfaces reads better with a hair more tracking (prose only). */
:root[data-theme="dark"] .hero__lede,
:root[data-theme="dark"] .about__body p,
:root[data-theme="dark"] .exp__desc,
:root[data-theme="dark"] .venture__desc,
:root[data-theme="dark"] .contact__lede { letter-spacing: .008em; }

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

/* ---- Browser surfaces (theme the parts we didn't draw) ---- */
::selection { background: var(--accent-quiet); color: var(--ink); }
html { scrollbar-color: var(--ink-faint) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-2); border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ---- Layout helpers ---- */
main { display: block; }
.hero, .about, .section, .hook, .nav, .site-footer > * {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.section, .about { padding-block: var(--section-y); }

.hero__title {
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  color: var(--accent);
  letter-spacing: .01em;
  margin-bottom: var(--space-8);
}
.section__title {
  font-size: var(--fs-xl);
  max-width: 22ch;
  margin-bottom: var(--space-8);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute; left: var(--space-4); top: -3rem;
  background: var(--surface); color: var(--ink);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  border: 1px solid var(--border); z-index: 100;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: var(--space-4); }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; gap: var(--space-6);
  padding-block: var(--space-3);
}
.nav__brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--ink); text-decoration: none; font-weight: 700; }
.nav__avatar {
  width: 2rem; height: 2rem; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--border);
  background: var(--surface-2);
}
.nav__name { font-family: var(--font-display); letter-spacing: -.01em; }
.nav__links { display: flex; gap: var(--space-6); margin-left: auto; }
.nav__links a {
  color: var(--ink-muted); text-decoration: none; font-size: var(--fs-sm);
  transition: color .15s var(--ease);
}
.nav__links a:hover { color: var(--ink); }

.theme-toggle {
  display: grid; place-items: center;
  width: 2.4rem; height: 2.4rem;
  background: var(--surface); color: var(--ink-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: color .15s var(--ease), background .15s var(--ease);
}
.theme-toggle:hover { color: var(--ink); background: var(--surface-2); }
.theme-toggle .icon--sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon--moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon--sun { display: block; }

/* ---- Hero ---- */
.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem) var(--section-y);
}
.hero__name {
  font-size: var(--fs-display);
  letter-spacing: -.035em;
  margin-block: 0 var(--space-3);
}
.hero__lede {
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 46ch;
  margin-bottom: var(--space-12);
}

.stats {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  border-block: 1px solid var(--border);
  margin-bottom: var(--space-12);
}
.stat {
  padding: var(--space-6) var(--space-4) var(--space-6) 0;
  border-left: 1px solid var(--border);
  padding-left: var(--space-4);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat__num {
  display: block;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.1rem);
  color: var(--ink); letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__unit { color: var(--accent); font-size: .55em; font-weight: 500; }
.stat__label {
  display: block; margin-top: var(--space-2);
  font-size: var(--fs-xs); color: var(--ink-muted); line-height: 1.35;
}

/* Metric reveal: JS counts numeric values up (slowly) as they scroll into view;
   each lands with an amber glow. `is-in` is added by the observer. Hero numbers
   settle to ink; inline metrics stay accent + bold. Global reduced-motion rule
   disables the animation; numbers still render final and correct without JS. */
.stat__num.is-in { animation: stat-land 1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes stat-land {
  0%   { color: var(--accent); text-shadow: 0 0 20px var(--accent-quiet); transform: translateY(4px); }
  60%  { text-shadow: 0 0 8px var(--accent-quiet); }
  100% { color: var(--ink); text-shadow: 0 0 0 transparent; transform: none; }
}
/* Inline figures inside role descriptions: highlighted by accent + weight
   (never hue alone), tabular so the count doesn't wobble. */
.metric { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.metric.is-in { animation: metric-land 1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes metric-land {
  0%   { text-shadow: 0 0 16px var(--accent-quiet); }
  60%  { text-shadow: 0 0 7px var(--accent-quiet); }
  100% { text-shadow: 0 0 0 transparent; }
}

.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* One authored entrance, hero only. CSS-only so content is never trapped hidden. */
@media (prefers-reduced-motion: no-preference) {
  .hero__name, .hero__title, .hero__lede, .stats, .hero__cta {
    animation: rise .55s var(--ease) both;
  }
  .hero__title { animation-delay: .06s; }
  .hero__lede  { animation-delay: .12s; }
  .stats       { animation-delay: .18s; }
  .hero__cta   { animation-delay: .24s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0 var(--space-6);
  border-radius: var(--radius); font-weight: 500; font-size: var(--fs-sm);
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--solid { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn--solid:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn--ghost { border-color: var(--border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-faint); background: var(--surface); color: var(--ink); }

/* ---- About ---- */
.about {
  display: grid; grid-template-columns: minmax(0, 260px) 1fr;
  gap: clamp(1.5rem, 5vw, 4rem); align-items: start;
}
.about__photo img {
  width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--border); filter: saturate(.96);
}
.about__body p { max-width: var(--measure); color: var(--ink-muted); margin-bottom: var(--space-4); }
.about__body p:first-of-type { color: var(--ink); }
.about__loc { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--ink-faint) !important; margin-top: var(--space-6); }

/* ---- Hook (personal one-liner, first thing on scroll) ---- */
.hook { border-top: 1px solid var(--border); padding-block: var(--section-y); }
.hook__lede {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.65rem, 1.1rem + 2.4vw, 3rem);
  line-height: 1.22; letter-spacing: -.025em;
  color: var(--ink); max-width: 26ch; text-wrap: balance;
}
.hook__lede em { font-style: normal; font-weight: 700; color: var(--accent); }
.hook__tags {
  font-family: var(--font-mono); font-size: var(--fs-sm);
  color: var(--ink-faint); margin-top: var(--space-8); line-height: 1.7;
}

/* ---- Experience ---- */
.exp { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.exp__item {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
}
.exp__item:first-child { border-top: 0; padding-top: 0; }
.exp__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}
.exp__role { font-size: var(--fs-md); font-weight: 700; }
.exp__team { color: var(--ink-faint); font-weight: 500; }
.exp__co { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent); text-decoration: none; }
.exp__co:hover { text-decoration: underline; }
.exp__co--plain { color: var(--ink-muted); }
.exp__desc { color: var(--ink-muted); max-width: var(--measure); margin-bottom: var(--space-4); }

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips li {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--ink-muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .2rem .55rem;
}

/* ---- Skills ---- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8) var(--space-12); }
.skills__group dt {
  font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent); margin-bottom: var(--space-3);
}
.skills__group dd { color: var(--ink); line-height: 1.9; }

/* ---- Ventures ---- */
.ventures { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.venture {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-6);
}
.venture__title { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.venture__title a { text-decoration: none; }
.venture__title a:hover { text-decoration: underline; }
.venture__role { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-faint); margin-bottom: var(--space-3); }
.venture__desc { color: var(--ink-muted); }

/* ---- Contact ---- */
.contact__lede { color: var(--ink-muted); max-width: 52ch; margin-bottom: var(--space-6); }
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.contact__mail { font-family: var(--font-mono); }
.copy-status {
  font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent);
  opacity: 0; transform: translateY(2px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.copy-status.show { opacity: 1; transform: none; }
.social { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-8); }
.social a {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--ink-muted); text-decoration: none; font-size: var(--fs-sm);
  transition: color .15s var(--ease);
}
.social a:hover { color: var(--accent); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-8);
}
.site-footer p { color: var(--ink-faint); font-size: var(--fs-sm); }

/* ---- High contrast preference ---- */
@media (prefers-contrast: more) {
  :root { --border: color-mix(in srgb, var(--ink) 55%, transparent); }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 220px; }
}
@media (max-width: 640px) {
  .nav__links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-left: 1px solid var(--border); padding-left: var(--space-4); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .skills, .ventures { grid-template-columns: 1fr; }
}
