/* ================================================================
   eayzzn Portfolio — README style, warm dark (default) / ivory light
   Mascot: Glitch (pixel slime), see src/scripts/mascot.js
   ================================================================ */

/* Self-hosted fonts (variable woff2, SIL Open Font License) */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #141413;
  --surface: #1F1E1C;
  --surface-2: #2A2926;
  --border: #2A2926;
  --border-strong: #3A3936;
  --text: #FAF9F5;
  --text-2: #B0AEA5;
  --text-3: #85837C;
  --accent: #D97757;
  --accent-text: #D97757;
  --accent-hover: #E8A386;
  --on-accent: #141413;
  --header-bg: rgba(20, 20, 19, 0.82);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --gutter: clamp(16px, 4vw, 24px);
  --header-h: 72px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

html[data-theme="light"] {
  --bg: #FAF9F5;
  --surface: #F0EEE6;
  --surface-2: #E6E3D9;
  --border: #E3E0D6;
  --border-strong: #CFCBBE;
  --text: #141413;
  --text-2: #4D4B46;
  --text-3: #6E6C66;
  --accent-text: #B4532F;
  --accent-hover: #9C4527;
  --header-bg: rgba(250, 249, 245, 0.85);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: inherit; }
a:hover { color: var(--accent-hover); }
button { font: inherit; color: inherit; }
ul { list-style: none; }

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

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ================================================================
   Header
   ================================================================ */

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

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

.site-header-inner {
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }

.site-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.site-nav-link:hover { color: var(--text); }
.site-nav-link.is-active { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }

.site-controls { display: flex; align-items: center; gap: 2px; color: var(--text-3); }

.lang-switch { display: flex; align-items: center; }

.lang-btn,
.theme-btn {
  min-width: 40px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.lang-btn:hover,
.theme-btn:hover { color: var(--text); }

.lang-btn[aria-pressed="true"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.theme-btn { min-width: 44px; }

/* Language swap fade (driven by i18n.js) */
[data-i18n], [data-i18n-html] {
  transition: opacity 0.3s var(--ease), filter 0.3s var(--ease);
}

html.is-lang-switching [data-i18n],
html.is-lang-switching [data-i18n-html] {
  opacity: 0;
  filter: blur(2px);
}

/* ================================================================
   Intro
   ================================================================ */

.intro {
  padding: 56px 0 88px;
  display: flex;
  flex-wrap: wrap-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.intro-text { flex: 999 1 440px; min-width: 0; }

.intro-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 7vw, 88px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.intro-cursor {
  color: var(--accent);
  animation: cursor-blink 1.1s steps(1, end) infinite;
}

@keyframes cursor-blink {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

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

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 20px;
  font-size: 13px;
}

.intro-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-2);
}

.intro-links a:hover { color: var(--accent-hover); }

.glitch-hero {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-lg);
}

/* ================================================================
   Sections
   ================================================================ */

/* every section opens with a full-width hairline, the ## label, a serif title and one line */
.section {
  padding: 56px 0 96px;
  border-top: 1px solid var(--border-strong);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  margin-bottom: 32px;
}

.section-intro { min-width: 0; flex: 1 1 420px; }

.section-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
}

.section-title {
  margin-top: 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}

.section-lead {
  margin-top: 10px;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

.section > .section-label { margin-bottom: 20px; }
.hash { color: var(--accent-text); }

/* ================================================================
   Projects
   ================================================================ */

.filter { display: flex; gap: 4px; font-size: 13px; }

.filter-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.filter-btn:hover { color: var(--text); }

.filter-btn[aria-pressed="true"] {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.project-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.project-card[hidden] { display: none; }

.project-preview {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.project-body {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.project-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.project-year { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.project-year--live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); }

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  animation: cursor-blink 1.4s steps(1, end) infinite;
}

.project-desc { font-size: 13px; color: var(--text-2); }

.project-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.project-tags { font-size: 12px; color: var(--accent-text); }

.project-links { display: flex; gap: 4px; font-size: 13px; }

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 8px;
}

/* Abstract previews (replace with real screenshots later) */
.mock {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
}

.mock span, .mock i { display: block; border-radius: 3px; background: var(--surface-2); }

.mock--web {
  width: 76%;
  height: 72%;
  padding: 0 14px 14px;
  border-radius: var(--radius-sm);
  transition: transform 0.35s var(--ease);
}

.mock--web .mock-bar { height: 14px; margin: 0 -14px 6px; border-radius: 0; background: var(--surface); border-bottom: 1px solid var(--border-strong); }
.mock--web .mock-title { width: 48%; height: 14px; background: var(--text-3); opacity: 0.6; }
.mock--web .mock-line { width: 30%; height: 6px; background: var(--accent); }
.mock .mock-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; background: none !important; }
.mock-cards i { height: 34px; }

.mock--phone {
  height: 82%;
  aspect-ratio: 9 / 18;
  padding: 18px 10px 10px;
  border-radius: 16px;
  transition: transform 0.35s var(--ease);
}

.mock--phone .mock-notch { position: absolute; top: 6px; left: 50%; width: 30%; height: 5px; transform: translateX(-50%); border-radius: 3px; }
.mock--phone .mock-title { width: 70%; height: 10px; background: var(--text-3); opacity: 0.6; }
.mock--phone .mock-line { width: 100%; height: 6px; }
.mock--phone .mock-line--short { width: 55%; }
.mock--phone .mock-block { margin-top: auto; height: 26%; background: var(--accent); opacity: 0.85; }

.project-card:hover .mock--web,
.project-card:hover .mock--phone { transform: translateY(-3px); }

/* Bettery: colour bubbles drifting slowly behind the battery, like a live wallpaper */
.project-preview--bettery { position: relative; background: #0c0a22; isolation: isolate; }

.project-preview--bettery .bubble {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
.project-preview--bettery .b1 { width: 75%; height: 120%; left: -18%; top: -38%; background: radial-gradient(closest-side, #2f68ff, rgba(47, 104, 255, 0)); animation: bubble-a 17s ease-in-out infinite alternate; }
.project-preview--bettery .b2 { width: 68%; height: 110%; right: -16%; top: -30%; background: radial-gradient(closest-side, #ff4fa0, rgba(255, 79, 160, 0)); animation: bubble-b 21s ease-in-out infinite alternate; }
.project-preview--bettery .b3 { width: 80%; height: 115%; left: 22%; bottom: -62%; background: radial-gradient(closest-side, #ff9a0a, rgba(255, 154, 10, 0)); animation: bubble-c 19s ease-in-out infinite alternate; }

@keyframes bubble-a { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(14%, 10%) scale(1.08); } 100% { transform: translate(6%, 22%) scale(.95); } }
@keyframes bubble-b { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-16%, 14%) scale(.92); } 100% { transform: translate(-6%, 26%) scale(1.06); } }
@keyframes bubble-c { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18%, -12%) scale(1.06); } 100% { transform: translate(12%, -20%) scale(.96); } }

@media (prefers-reduced-motion: reduce) { .project-preview--bettery .bubble { animation: none; } }

.bettery-mock { position: relative; width: 36%; overflow: visible; transition: transform 0.35s var(--ease); }
.project-card:hover .bettery-mock { transform: translateY(-3px) scale(1.03); }

.project-preview--wip {
  background-color: var(--surface-2);
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 12px 12px;
}

/* ================================================================
   Skills + contact
   ================================================================ */

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.skill-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s var(--ease);
}

.skill-group:hover { border-color: var(--border-strong); }
.skill-group-title { font-size: 14px; font-weight: 500; color: var(--text); }
.skill-group-desc { font-size: 13px; line-height: 1.55; color: var(--text-3); }
.skill-group .skill-list { margin-top: auto; padding-top: 6px; }

.skill-list { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }

.skill-list li {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

/* contact: one card; Glitch stands on its top edge, right of the heading, hopping with his letter */
.contact-card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.contact-text { min-width: 0; }
.contact-lead { max-width: 440px; margin-bottom: 22px; font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* the scene's bottom edge is Glitch's feet, so it rests exactly on the card border */
.contact-art { position: absolute; right: 56px; bottom: calc(100% - 1px); width: 300px; pointer-events: none; }
.contact-art .glitch--contact { margin: 0; max-width: none; }

@media (max-width: 720px) {
  .contact-card { margin-top: 112px; padding: 20px; }   /* collapses with the heading margin: room for Glitch + heart */
  .contact-art { right: 12px; width: 200px; }
}

.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.btn-primary:hover { color: var(--on-accent); filter: brightness(1.08); transform: translateY(-1px); }

.contact-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text-2);
}

/* ================================================================
   Footer
   ================================================================ */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  padding-bottom: 32px;
  /* same inset hairline as the sections above, not the full container width */
  background: linear-gradient(var(--border-strong), var(--border-strong)) var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  font-size: 12px;
  color: var(--text-3);
}

.footer-legal { display: flex; gap: 20px; }
.footer-legal a { color: var(--text-3); }
.footer-legal a:hover { color: var(--accent-hover); }
.footer-legal a[aria-current="page"] { color: var(--text); }

/* ================================================================
   Legal pages (impressum, datenschutz)
   ================================================================ */

.legal {
  max-width: 760px;
  padding-top: 48px;
  padding-bottom: 96px;
}

.legal-notice {
  margin-bottom: 40px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
}

.legal-notice strong { color: var(--text); font-weight: 500; }

.legal-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.legal h2 {
  margin: 36px 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
}

.legal h2::before { content: "## "; color: var(--accent-text); }

.legal p,
.legal li {
  font-size: 14px;
  color: var(--text-2);
}

.legal p + p { margin-top: 12px; }
.legal ul { margin: 10px 0 12px; padding-left: 20px; list-style: "– "; }
.legal a { color: var(--text); }
.legal a:hover { color: var(--accent-hover); }
.legal-date { margin-top: 40px; font-size: 12px; }

/* Test data still to be replaced */
.placeholder {
  color: var(--text);
  background: var(--surface-2);
  border-bottom: 1px dashed var(--accent);
  padding: 0 4px;
}

/* ================================================================
   Glitch — pixel mascot
   States via [data-state]: idle | hallo | glitch | sleep
   ================================================================ */

.glitch { display: block; }
.glitch--mini { width: 24px; height: 30px; }
.glitch--hero { width: 176px; height: 220px; }
.glitch--card { width: 104px; height: 130px; }

.glitch-svg { display: block; width: 100%; height: 100%; overflow: visible; }

.gl-face,
.gl-asleep { display: none; }

[data-state="idle"] .gl-face-idle,
[data-state="hallo"] .gl-face-happy,
[data-state="glitch"] .gl-face-code { display: inline; }

[data-state="sleep"] .gl-awake { display: none; }
[data-state="sleep"] .gl-asleep { display: inline; }

.gl-awake,
.gl-sleep-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

[data-state="idle"] .gl-awake { animation: gl-wobble 1.2s steps(1, end) infinite; }
[data-state="hallo"] .gl-awake { animation: gl-hop 1s steps(1, end) infinite; }
[data-state="glitch"] .gl-awake { animation: gl-jit 2.4s steps(1, end) infinite; }
.gl-sleep-body { animation: gl-breathe 3.2s steps(1, end) infinite; }

@keyframes gl-wobble {
  0%   { transform: scale(1, 1); }
  25%  { transform: scale(1.07, 0.93); }
  50%  { transform: scale(1, 1); }
  75%  { transform: scale(0.95, 1.06); }
  100% { transform: scale(1, 1); }
}

@keyframes gl-hop {
  0%   { transform: translateY(0) scale(1.1, 0.9); }
  15%  { transform: translateY(0) scale(0.92, 1.1); }
  30%  { transform: translateY(-3px) scale(0.95, 1.05); }
  50%  { transform: translateY(-4px) scale(1, 1); }
  70%  { transform: translateY(-2px) scale(1, 1); }
  85%  { transform: translateY(0) scale(1.1, 0.9); }
  100% { transform: translateY(0) scale(1, 1); }
}

@keyframes gl-jit {
  0%   { transform: translateX(1px); }
  4%   { transform: translateX(-1px); }
  8%   { transform: translateX(0); }
  50%  { transform: translateX(0); }
  52%  { transform: translateX(1px); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(0); }
}

@keyframes gl-breathe {
  0%   { transform: scale(1, 1); }
  50%  { transform: scale(1.03, 1.15); }
  100% { transform: scale(1, 1); }
}

/* Eye blink */
.gl-eyes-open { animation: gl-open 4s infinite; }
.gl-eyes-closed { opacity: 0; animation: gl-closed 4s infinite; }
@keyframes gl-open { 0%, 92%, 100% { opacity: 1; } 93%, 96% { opacity: 0; } }
@keyframes gl-closed { 0%, 92%, 100% { opacity: 0; } 93%, 96% { opacity: 1; } }

/* Prompt cursor in the coding face */
.gl-cursor { animation: cursor-blink 0.9s steps(1, end) infinite; }

/* RGB-split copies, only visible while glitching */
.gl-split { opacity: 0; }
.gl-split-a { fill: #FAF9F5; }
.gl-split-b { fill: #A9583D; }
html[data-theme="light"] .gl-split-a { fill: #6FA8D9; }
[data-state="glitch"] .gl-split-a { animation: gl-split-a 2.4s steps(1, end) infinite; }
[data-state="glitch"] .gl-split-b { animation: gl-split-b 2.4s steps(1, end) infinite; }

@keyframes gl-split-a {
  0%   { opacity: 0.85; transform: translateX(-2px); }
  4%   { opacity: 0.85; transform: translateX(1px); }
  8%   { opacity: 0; transform: translateX(0); }
  52%  { opacity: 0.85; transform: translateX(-1px); }
  55%  { opacity: 0; transform: translateX(0); }
  100% { opacity: 0; }
}

@keyframes gl-split-b {
  0%   { opacity: 0.85; transform: translateX(2px); }
  4%   { opacity: 0.85; transform: translateX(-1px); }
  8%   { opacity: 0; transform: translateX(0); }
  52%  { opacity: 0.85; transform: translateX(1px); }
  55%  { opacity: 0; transform: translateX(0); }
  100% { opacity: 0; }
}

/* Floating z's while asleep */
.gl-z { fill: var(--text-3); opacity: 0; animation: gl-z 3s steps(6) infinite; }
.gl-z2 { animation-delay: 1s; }
.gl-z3 { animation-delay: 2s; }

@keyframes gl-z {
  0%      { opacity: 0; transform: translate(0, 3px); }
  15%, 80% { opacity: 1; }
  100%    { opacity: 0; transform: translate(1px, -3px); }
}

/* Contact scene: "post" (loop) / "send" (one-shot paper plane) */
.glitch--contact { width: 100%; max-width: 400px; height: auto; aspect-ratio: 56 / 30; }

.glc-post,
.glc-heart { transform-box: fill-box; }


.glc-post { transform-origin: 50% 100%; animation: glc-hop 1.4s steps(1, end) infinite; }
.glc-heart { opacity: 0; animation: glc-heart 2.8s steps(5) infinite; }

@keyframes glc-hop {
  0%   { transform: translateY(0) scale(1.08, 0.92); }
  15%  { transform: translateY(0) scale(0.94, 1.08); }
  30%  { transform: translateY(-3px); }
  50%  { transform: translateY(-4px); }
  70%  { transform: translateY(-2px); }
  85%  { transform: translateY(0) scale(1.08, 0.92); }
  100% { transform: translateY(0); }
}

@keyframes glc-heart {
  0%      { opacity: 0; transform: translateY(2px); }
  10%, 70% { opacity: 1; }
  100%    { opacity: 0; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .glc-heart { opacity: 1; }
  .glitch *,
  .intro-cursor,
  .live-dot { animation: none !important; }
  .gl-z { opacity: 1; }
  .gl-eyes-closed { opacity: 0; }
  .project-card,
  .mock--web,
  .mock--phone { transition: none; }
}

/* ================================================================
   Small screens
   ================================================================ */

@media (max-width: 560px) {
  :root { --header-h: 112px; }
  .site-header-inner { padding-top: 8px; padding-bottom: 8px; }
  .site-nav { order: 3; width: 100%; margin-left: -8px; }
  .intro { padding: 32px 0 64px; }
  .glitch--hero { width: 128px; height: 160px; }
  .glitch--contact { max-width: 300px; }
  .section { padding: 44px 0 72px; }
  .section-head { margin-bottom: 24px; }
}
