/* =========================================================
   Portfolio — Rubik, charcoal & warm cream
   Hand-written CSS. No build step.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #151517;
  --bg-soft: #1a1a1d;
  --surface: #1d1d21;
  --surface-2: #242429;
  --surface-3: #2c2c32;
  --text: #f5f1e8;
  --text-soft: #ded9cf;
  --muted: #a9a49b;
  --faint: #8b867d;
  --border: rgba(245, 241, 232, 0.09);
  --border-strong: rgba(245, 241, 232, 0.16);
  --accent: #f0c9a2;
  --accent-soft: #f8dcc0;
  --accent-contrast: #241a10;
  --btn-bg: #f0c9a2;
  --btn-bg-hover: #f8dcc0;
  --btn-ink: #241a10;
  --btn-shadow: rgba(240, 201, 162, 0.2);
  --btn-ghost-bg: rgba(255, 255, 255, 0.015);
  --tag-s: 70%;
  --tag-l: 74%;
  --tag-bg-alpha: 0.11;
  --card-hover-border: rgba(240, 201, 162, 0.38);
  --card-shadow-hover: 0 26px 60px -30px rgba(0, 0, 0, 0.9);
  --header-bg: rgba(21, 21, 23, 0.72);
  --glow-1: rgba(240, 201, 162, 0.13);
  --glow-2: rgba(139, 167, 255, 0.06);
  --dot: rgba(255, 255, 255, 0.05);
  --contact-glow: rgba(240, 201, 162, 0.12);
  --shimmer-mid: #303036;
  --shadow-soft: 0 24px 70px -40px rgba(0, 0, 0, 0.85);
  --font: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  --shell: 1080px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e8;
  --bg-soft: #efe8db;
  --surface: #fffcf6;
  --surface-2: #f2ebdf;
  --surface-3: #e9e0d1;
  --text: #24201a;
  --text-soft: #3a342b;
  --muted: #665f54;
  --faint: #6f675b;
  --border: rgba(43, 35, 25, 0.11);
  --border-strong: rgba(43, 35, 25, 0.19);
  --accent: #955628;
  --accent-soft: #7d451f;
  --accent-contrast: #fff8ef;
  --btn-bg: #26211b;
  --btn-bg-hover: #3a3228;
  --btn-ink: #fbf5e9;
  --btn-shadow: rgba(50, 39, 25, 0.2);
  --btn-ghost-bg: rgba(255, 255, 255, 0.42);
  --tag-s: 58%;
  --tag-l: 31%;
  --tag-bg-alpha: 0.1;
  --card-hover-border: rgba(149, 86, 40, 0.35);
  --card-shadow-hover: 0 26px 60px -34px rgba(61, 44, 26, 0.35);
  --header-bg: rgba(246, 241, 232, 0.78);
  --glow-1: rgba(214, 154, 94, 0.2);
  --glow-2: rgba(139, 167, 255, 0.1);
  --dot: rgba(43, 35, 25, 0.07);
  --contact-glow: rgba(214, 154, 94, 0.16);
  --shimmer-mid: #e9e0d2;
  --shadow-soft: 0 24px 70px -40px rgba(61, 44, 26, 0.3);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  scrollbar-color: var(--border-strong) transparent;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(var(--dot) 1px, transparent 1px),
    radial-gradient(60rem 42rem at 50% -12%, var(--glow-1), transparent 62%),
    radial-gradient(42rem 34rem at 104% 18%, var(--glow-2), transparent 62%);
  background-size: 24px 24px, auto, auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

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

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

button {
  color: inherit;
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

ul {
  margin: 0;
  padding: 0;
}

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

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

.shell {
  width: min(calc(100% - (2 * var(--gutter))), var(--shell));
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 13px;
  font-weight: 500;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  transition: transform 0.4s var(--ease), border-color 0.3s ease, background-color 0.3s ease;
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.brand:hover .brand-mark {
  border-color: var(--border-strong);
  transform: rotate(90deg);
}

.brand-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13.5px;
}

.site-nav a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

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

.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

.theme-toggle {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.3s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transform: rotate(-12deg);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.icon-sun,
.icon-moon {
  display: none;
}

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

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

/* ---------- Notices ---------- */

.config-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(240, 201, 162, 0.24);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.config-notice p {
  flex: 1;
  margin: 0;
}

.notice-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--btn-shadow);
}

.notice-close {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: color 0.2s ease;
}

.notice-close:hover {
  color: var(--text);
}

.noscript {
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease,
    transform 0.25s var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  border-color: var(--btn-bg);
  background: var(--btn-bg);
  box-shadow: 0 8px 26px -14px var(--btn-shadow);
  color: var(--btn-ink);
}

.btn-primary:hover {
  border-color: var(--btn-bg-hover);
  background: var(--btn-bg-hover);
  box-shadow: 0 14px 34px -16px var(--btn-shadow);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: var(--btn-ghost-bg);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--surface);
  transform: translateY(-2px);
}

.btn-sm {
  height: 38px;
  gap: 7px;
  padding: 0 13px;
  border-radius: 10px;
  font-size: 12.5px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(64px, 10vw, 116px);
  padding-bottom: clamp(76px, 10vw, 124px);
  text-align: center;
}

.avatar-wrap {
  width: 124px;
  height: 124px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(
    from 210deg,
    var(--accent) 0%,
    rgba(167, 139, 250, 0.55) 26%,
    var(--surface-3) 50%,
    var(--accent) 74%,
    var(--accent) 100%
  );
  box-shadow: 0 0 70px -24px var(--btn-shadow);
  animation: rise 0.8s var(--ease) 0.05s both;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.avatar-wrap:hover .avatar {
  transform: scale(1.025);
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 26px;
  animation: rise 0.8s var(--ease) 0.12s both;
}

.status-pill {
  display: inline-flex;
  height: 28px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  line-height: 1;
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #7fc99c;
  box-shadow: 0 0 0 3px rgba(127, 201, 156, 0.12);
  animation: pulse 2.8s ease-in-out infinite;
}

.handle {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.hero h1 {
  margin: 16px 0 0;
  font-size: clamp(2.9rem, 7vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
  animation: rise 0.85s var(--ease) 0.18s both;
}

.role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 15px 0 0;
  color: var(--accent);
  font-size: clamp(0.98rem, 1.8vw, 1.13rem);
  font-weight: 500;
  letter-spacing: 0.012em;
  animation: rise 0.85s var(--ease) 0.24s both;
}

.role::before,
.role::after {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
  content: "";
  opacity: 0.55;
}

.role::after {
  background: linear-gradient(90deg, var(--accent), transparent);
}

.bio {
  max-width: 620px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.02rem);
  line-height: 1.8;
  text-wrap: balance;
  animation: rise 0.85s var(--ease) 0.3s both;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 30px;
  animation: rise 0.85s var(--ease) 0.38s both;
}

.socials .btn {
  height: 44px;
  padding-inline: 18px;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 22px 0 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.015em;
  animation: rise 0.85s var(--ease) 0.44s both;
}

.hero-meta svg {
  width: 13px;
  height: 13px;
  opacity: 0.8;
}

/* ---------- Projects ---------- */

.projects {
  padding-top: clamp(22px, 3vw, 34px);
  padding-bottom: clamp(20px, 4vw, 44px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.95rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.05;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.count-pill {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.section-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s var(--ease);
}

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

.section-link:hover svg {
  transform: translate(2px, -2px);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s var(--ease);
}

.project-card:hover,
.project-card:focus-within {
  border-color: var(--card-hover-border);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-5px);
}

.project-card.is-skeleton {
  pointer-events: none;
}

.project-card.is-skeleton:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
  transform: none;
}

.project-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}

.project-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s var(--ease);
}

.project-media::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), transparent 35%, rgba(0, 0, 0, 0.14));
  content: "";
  pointer-events: none;
}

.project-card:hover .project-media img {
  transform: scale(1.035);
}

.project-fallback {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 20% 10%, hsl(var(--hue, 30) 35% 30% / 0.7), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--surface-3));
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.project-index {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(14, 14, 17, 0.62);
  color: #f4e7d7;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.3;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 19px 20px 18px;
}

.project-title {
  margin: 0 0 8px;
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.3;
}

.project-desc {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

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

.tag {
  padding: 3px 8px;
  border: 1px solid hsl(var(--hue, 30) 60% 55% / 0.22);
  border-radius: 999px;
  background: hsl(var(--hue, 30) 60% 55% / var(--tag-bg-alpha));
  color: hsl(var(--hue, 30) var(--tag-s) var(--tag-l));
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1.55;
  white-space: nowrap;
}

.project-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ---------- Loading & states ---------- */

.sk-media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--shimmer-mid) 50%, var(--surface-2) 75%);
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.sk-body {
  padding: 19px 20px 20px;
}

.sk-line {
  height: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--shimmer-mid) 50%, var(--surface-2) 75%);
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.sk-line.is-title {
  width: 54%;
  height: 15px;
  margin-bottom: 15px;
}

.sk-line.is-short {
  width: 38%;
}

.sk-tags {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.sk-tags span {
  width: 48px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-2);
}

.projects-state {
  padding: clamp(34px, 6vw, 56px) 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.state-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
}

.state-icon svg {
  width: 19px;
  height: 19px;
}

.projects-state h3 {
  margin: 0 0 7px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.projects-state p {
  max-width: 480px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.projects-state code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.9em;
}

.projects-state .btn {
  margin-top: 18px;
}

/* ---------- Contact ---------- */

.contact {
  padding-top: clamp(34px, 6vw, 64px);
  padding-bottom: clamp(44px, 7vw, 80px);
}

.contact-card {
  position: relative;
  display: flex;
  overflow: hidden;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(110% 160% at 100% 0%, var(--contact-glow), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.contact-star {
  position: absolute;
  top: -16px;
  right: 34px;
  width: 150px;
  height: 150px;
  color: var(--accent);
  opacity: 0.07;
  pointer-events: none;
  transform: rotate(12deg);
}

.contact-copy,
.contact-actions {
  position: relative;
  z-index: 1;
}

.contact-copy {
  max-width: 600px;
}

.contact-copy h2 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.12;
  text-wrap: balance;
}

.contact-copy p:last-child {
  max-width: 490px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.contact-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 9px;
  padding-bottom: 4px;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 24px;
  padding-bottom: 38px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.site-footer p {
  margin: 0;
}

.footer-sep {
  margin-inline: 4px;
  opacity: 0.6;
}

.footer-top {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.footer-top svg {
  width: 13px;
  height: 13px;
  transition: transform 0.25s var(--ease);
}

.footer-top:hover {
  color: var(--accent);
}

.footer-top:hover svg {
  transform: translateY(-2px);
}

/* ---------- Motion ---------- */

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

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -20% 0;
  }
}

.reveal {
  opacity: 0;
}

.reveal.is-visible {
  opacity: 1;
  animation: card-in 0.7s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}

html.is-theme-changing *,
html.is-theme-changing *::before,
html.is-theme-changing *::after {
  transition:
    background-color 0.28s ease,
    border-color 0.28s ease,
    color 0.28s ease,
    box-shadow 0.28s ease !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .contact-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .contact-copy {
    max-width: 100%;
  }

  .contact-actions {
    padding-bottom: 0;
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 84px;
  }

  .header-inner {
    height: 66px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .section-meta {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
  }

  .hero {
    padding-top: 52px;
    padding-bottom: 84px;
  }

  .avatar-wrap {
    width: 112px;
    height: 112px;
  }
}

@media (max-width: 560px) {
  .site-nav {
    gap: 16px;
    font-size: 13px;
  }

  .site-header .brand-name {
    max-width: 110px;
  }

  .config-notice {
    align-items: flex-start;
    font-size: 12px;
  }

  .notice-close {
    margin-top: -3px;
  }

  .hero-eyebrow {
    flex-wrap: wrap;
    gap: 9px;
  }

  .role {
    gap: 10px;
  }

  .role::before,
  .role::after {
    width: 18px;
  }

  .socials {
    width: 100%;
    max-width: 360px;
  }

  .socials .btn {
    flex: 1 1 auto;
  }

  .socials .btn-primary {
    flex-basis: 100%;
  }

  .project-actions .btn {
    flex: 1;
  }

  .contact-actions {
    width: 100%;
  }

  .contact-actions .btn {
    flex: 1;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 30px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .site-header .brand-name {
    max-width: 96px;
  }

  .header-inner {
    gap: 12px;
  }

  .site-nav {
    gap: 14px;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 12.5vw, 3rem);
  }

  .bio {
    font-size: 0.93rem;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
  }
}
