/**
 * Hosam Othman — Portfolio
 *
 * 1. Tokens & themes
 * 2. Base
 * 3. Layout
 * 4. Header & navigation
 * 5. Components
 * 6. Home
 * 7. Inner pages
 * 8. Footer
 * 9. Motion
 * 10. Responsive
 */

/* ---------------------------------------------------------------------------
 * 1. Tokens & themes
 * ------------------------------------------------------------------------- */

:root {
  --font-sans:
    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --font-mono:
    "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f3f3f0;
  --text: #111113;
  --text-muted: #5b5b64;
  --text-faint: #8b8b94;
  --border: #e6e6e1;
  --border-strong: #d4d4cd;
  --accent: #e8590c;
  --accent-text: #c2410c;
  --accent-soft: rgba(232, 89, 12, 0.1);
  --inverse-bg: #111113;
  --inverse-text: #fafaf8;
  --header-bg: rgba(250, 250, 248, 0.8);
  --feature-bg: #111113;
  --feature-text: #fafaf8;
  --feature-border: #111113;
  --shadow-sm: 0 1px 2px rgba(17, 17, 19, 0.05);
  --shadow-md:
    0 1px 2px rgba(17, 17, 19, 0.04), 0 12px 32px -12px rgba(17, 17, 19, 0.12);

  /* 3D scene palette (read by js/hero-scene.js) */
  --scene-bg: #ffffff;
  --scene-slab: #ffffff;
  --scene-panel: #f3f3f0;
  --scene-edge: #cfcfc9;
  --scene-ink: #2c2c33;
  --scene-line: #b4b4bb;
  --scene-shadow: #111113;
  --scene-shadow-opacity: 0.08;
  --scene-grid: rgba(17, 17, 19, 0.06);

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --section-space: clamp(64px, 9vw, 120px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #19191d;
  --text: #ededef;
  --text-muted: #a1a1aa;
  --text-faint: #6b6b74;
  --border: #232328;
  --border-strong: #303037;
  --accent: #ff7a3d;
  --accent-text: #ff8c55;
  --accent-soft: rgba(255, 122, 61, 0.12);
  --inverse-bg: #ededef;
  --inverse-text: #0b0b0d;
  --header-bg: rgba(11, 11, 13, 0.75);
  --feature-bg: #16161a;
  --feature-text: #ededef;
  --feature-border: #2a2a30;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);

  --scene-bg: #131316;
  --scene-slab: #1e1e23;
  --scene-panel: #27272d;
  --scene-edge: #3b3b43;
  --scene-ink: #c9c9d0;
  --scene-line: #55555e;
  --scene-shadow: #000000;
  --scene-shadow-opacity: 0.35;
  --scene-grid: rgba(255, 255, 255, 0.05);

  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
 * 2. Base
 * ------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

main {
  flex: 1;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--text);
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* ---------------------------------------------------------------------------
 * 3. Layout
 * ------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-space);
}

.section + .section {
  padding-top: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.section-title {
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
}

.section-lead {
  max-width: 56ch;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------------------------------------------------------------------------
 * 4. Header & navigation
 * ------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.is-scrolled,
.site-header.is-open {
  border-bottom-color: var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--inverse-bg);
  color: var(--inverse-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.lang-switch button {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn .icon {
  grid-area: 1 / 1;
}

.theme-toggle .icon-moon,
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.menu-toggle {
  display: none;
}

.menu-toggle .icon-close,
.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

/* ---------------------------------------------------------------------------
 * 5. Components
 * ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding-inline: 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease-out);
}

.btn:hover .icon-arrow {
  transform: translateX(3px);
}

.btn-primary {
  background: var(--inverse-bg);
  color: var(--inverse-text);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--inverse-bg) 85%, var(--accent));
}

.btn-secondary {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--text-faint);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: border-color 0.15s ease;
}

.text-link:hover {
  border-color: var(--accent);
}

.text-link .icon {
  width: 16px;
  height: 16px;
}

/* ---------------------------------------------------------------------------
 * 6. Home
 * ------------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  min-height: min(780px, calc(100svh - var(--header-h)));
  padding-block: clamp(40px, 6vw, 72px);
}

.hero-title {
  font-size: clamp(2.5rem, 1.4rem + 4.2vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-title .muted {
  color: var(--text-faint);
}

.hero-lead {
  max-width: 54ch;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-stack {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-stack-label {
  margin-bottom: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 3D viewport — js/hero-scene.js renders into the canvas */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--scene-bg);
  background-image: radial-gradient(var(--scene-grid) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  isolation: isolate;
}

.hero-visual canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: grab;
  touch-action: pan-y;
  transition: opacity 1.2s ease;
}

.hero-visual canvas:active {
  cursor: grabbing;
}

.hero-visual.is-ready canvas {
  opacity: 1;
}

.scene-label {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.scene-label-tl {
  top: 16px;
  left: 18px;
  color: var(--text-muted);
}

.scene-label-bl {
  bottom: 16px;
  left: 18px;
}

.scene-label-br {
  bottom: 16px;
  right: 18px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2s ease-in-out infinite;
}

/* Layer labels: js/hero-scene.js moves each one to its layer's left corner */
.scene-tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: -14px;
  translate: -100% -50%;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
}

.hero-visual.is-ready .scene-tag {
  opacity: 1;
}

.scene-tag-name {
  color: var(--text);
  font-weight: 500;
}

.scene-tag-tech {
  color: var(--text-faint);
}

.hero-visual.is-fallback .scene-label-bl,
.hero-visual.is-fallback .scene-label-br,
.hero-visual.is-fallback .scene-tag {
  display: none;
}

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--border);
  list-style: none;
  padding: 0;
}

.metric {
  padding: clamp(24px, 3vw, 36px) clamp(16px, 2vw, 28px);
}

.metric:first-child {
  padding-left: 0;
}

.metric + .metric {
  border-left: 1px solid var(--border);
}

.metric-value {
  display: block;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.metric-value .arrow {
  color: var(--accent);
  font-weight: 500;
}

.metric-label {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Selected work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 3vw, 32px);
  transition:
    border-color 0.2s ease,
    transform 0.2s var(--ease-out);
}

.work-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.work-card .work-meta {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.work-card h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.work-card p {
  color: var(--text-muted);
}

.work-card .tags {
  margin-top: auto;
  padding-top: 8px;
}

/* Call to action */
.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 48px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--feature-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 160% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--feature-bg);
  color: var(--feature-text);
}

.cta h2 {
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.375rem);
}

.cta p {
  margin-top: 10px;
  color: color-mix(in srgb, var(--feature-text) 65%, transparent);
}

.cta .btn {
  background: var(--accent);
  color: #fff;
}

.cta .btn:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}

:root[data-theme="dark"] .cta .btn {
  color: #0b0b0d;
}

/* ---------------------------------------------------------------------------
 * 7. Inner pages
 * ------------------------------------------------------------------------- */

.page-hero {
  padding-block: clamp(48px, 8vw, 104px) clamp(32px, 5vw, 56px);
}

.page-title {
  max-width: 18ch;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  letter-spacing: -0.04em;
}

.page-lead {
  max-width: 60ch;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.portrait {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.portrait figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.portrait figcaption .icon {
  width: 16px;
  height: 16px;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: 1.375rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}

.fact {
  padding: 20px 22px;
  background: var(--surface);
}

.fact dt {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fact dd {
  margin: 6px 0 0;
  font-weight: 500;
}

.lang-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  list-style: none;
  padding: 0;
}

.lang-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(64px, auto);
  align-items: center;
  gap: 16px;
}

.lang-item .name {
  font-weight: 500;
}

.lang-item .level {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-align: right;
}

.lang-meter {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.lang-meter span {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}

.lang-meter span.on {
  background: var(--text);
}

/* Experience timeline */
.timeline {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--border);
}

.role {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 16px clamp(24px, 5vw, 64px);
  padding-block: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--border);
}

.role-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.role-date {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
}

.role-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 500;
}

.role-current::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.role-title {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  letter-spacing: -0.02em;
}

.role-company {
  margin-top: 4px;
  color: var(--text-muted);
  font-weight: 500;
}

.role-points {
  display: grid;
  gap: 10px;
  max-width: 78ch;
  margin-top: 20px;
  list-style: none;
  padding: 0;
}

.role-points li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
  line-height: 1.6;
}

.role-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 8px;
  height: 1.5px;
  background: var(--accent);
}

.role .tags {
  margin-top: 20px;
}

.role-text {
  margin-top: 16px;
  color: var(--text-muted);
}

.role-note {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 0.875rem;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
}

.skill-card {
  padding: 24px;
}

.skill-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}


.skill-card.is-featured {
  grid-column: 1 / -1;
  background:
    radial-gradient(80% 220% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--feature-bg);
  border-color: var(--feature-border);
  color: var(--feature-text);
}


.skill-card.is-featured .tag {
  border-color: color-mix(in srgb, var(--feature-text) 18%, transparent);
  background: transparent;
  color: var(--feature-text);
  font-size: 0.8125rem;
  padding: 6px 14px;
}

/* Contact */
.contact-list {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
}

.contact-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  transition: border-color 0.2s ease;
}

.contact-item:hover {
  border-color: var(--border-strong);
}

.contact-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
}

.contact-body {
  min-width: 0;
  flex: 1;
}

.contact-label {
  display: block;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-value {
  display: block;
  margin-top: 2px;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Whole card is clickable via the stretched link */
.contact-value::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.contact-arrow {
  color: var(--text-faint);
  transition:
    transform 0.2s var(--ease-out),
    color 0.2s ease;
}

.contact-item:hover .contact-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.copy-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding-inline: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.copy-btn .icon {
  width: 15px;
  height: 15px;
}

.copy-btn .icon-check,
.copy-btn.is-copied .icon-copy {
  display: none;
}

.copy-btn.is-copied .icon-check {
  display: block;
  color: var(--accent);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.contact-aside {
  padding: 28px;
}

.contact-aside h2 {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.contact-aside p {
  margin-top: 10px;
  color: var(--text-muted);
}

.contact-aside .tags {
  margin-top: 18px;
}

/* ---------------------------------------------------------------------------
 * 8. Footer
 * ------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--section-space);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  padding: 0;
}

.footer-links a:hover {
  color: var(--text);
}

/* ---------------------------------------------------------------------------
 * 9. Motion
 * ------------------------------------------------------------------------- */

@keyframes live-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-copy > *,
.page-hero > * {
  animation: rise 0.8s var(--ease-out) both;
}

.hero-copy > :nth-child(2),
.page-hero > :nth-child(2) {
  animation-delay: 0.06s;
}

.hero-copy > :nth-child(3),
.page-hero > :nth-child(3) {
  animation-delay: 0.12s;
}

.hero-copy > :nth-child(4) {
  animation-delay: 0.18s;
}

.hero-copy > :nth-child(5) {
  animation-delay: 0.24s;
}

.hero-visual {
  animation: rise 1s 0.15s var(--ease-out) both;
}

/* Scroll reveal: js/reveal.js only hides elements that start below the fold */
[data-reveal] {
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.reveal-ready [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(16px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-ready [data-reveal]:not(.is-visible) {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
 * 10. Responsive
 * ------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-visual {
    max-width: 560px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .nav-ready .menu-toggle {
    display: inline-grid;
  }

  .nav-ready .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.2s ease,
      transform 0.2s var(--ease-out),
      visibility 0.2s;
  }

  .nav-ready .site-header.is-open .site-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-ready .site-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .nav-ready .site-nav a {
    padding: 12px;
    font-size: 1.0625rem;
  }

  /* Without JS the menu stays a simple scrollable row */
  html:not(.nav-ready) .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 12px;
  }

  html:not(.nav-ready) .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  html:not(.nav-ready) .menu-toggle {
    display: none;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .portrait {
    position: static;
    max-width: 420px;
  }

  .role {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
  }

  .role-current {
    margin-top: 0;
  }

  .cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .cta .btn {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .work-grid,
  .skills-grid,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric {
    padding-inline: 0 12px;
  }

  .metric:nth-child(even) {
    padding-left: 16px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .lang-item {
    grid-template-columns: 76px minmax(0, 1fr) minmax(56px, auto);
    gap: 12px;
  }

  .contact-item {
    padding: 16px;
    gap: 14px;
  }

  .contact-arrow {
    display: none;
  }

  .copy-btn .copy-text {
    display: none;
  }

  .copy-btn {
    padding-inline: 9px;
  }
}

@media (max-width: 380px) {
  .brand-name {
    display: none;
  }
}
