/* =============================================================
   GreekDev.io — Ioannis Karasavvaidis
   Design system + layout
   ============================================================= */

/* ---- Theme tokens ------------------------------------------- */
:root {
  /* Accent (overridable via Tweaks). Default = Aegean blue */
  --accent: oklch(0.58 0.13 248);
  --accent-soft: oklch(0.58 0.13 248 / 0.12);
  --accent-line: oklch(0.58 0.13 248 / 0.28);

  /* Type families (overridable via Tweaks) */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Fluid type scale */
  --step--1: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.12rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.6vw, 5rem);
  --step-5: clamp(2.1rem, 1.1rem + 5vw, 7rem);

  /* Layout */
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --radius: 14px;
  --radius-sm: 9px;
}

/* Dark (default) */
:root,
:root[data-theme="dark"] {
  --bg: oklch(0.17 0.008 250);
  --bg-2: oklch(0.205 0.009 250);
  --surface: oklch(0.225 0.01 250);
  --surface-2: oklch(0.255 0.012 250);
  --border: oklch(1 0 0 / 0.09);
  --border-strong: oklch(1 0 0 / 0.16);
  --text: oklch(0.96 0.004 250);
  --text-muted: oklch(0.72 0.012 250);
  --text-faint: oklch(0.56 0.012 250);
  /* contrast-tuned accent for small text on dark bg (>=4.5:1) */
  --accent-text: color-mix(in oklch, var(--accent) 58%, white);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.4), 0 18px 40px -20px oklch(0 0 0 / 0.55);
  --grain-opacity: 0.035;
  color-scheme: dark;
}

/* Light */
:root[data-theme="light"] {
  --bg: oklch(0.985 0.004 90);
  --bg-2: oklch(0.965 0.005 90);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.004 90);
  --border: oklch(0.2 0.02 250 / 0.12);
  --border-strong: oklch(0.2 0.02 250 / 0.22);
  --text: oklch(0.24 0.014 255);
  --text-muted: oklch(0.45 0.014 255);
  --text-faint: oklch(0.58 0.012 255);
  /* contrast-tuned accent for small text on light bg (>=4.5:1) */
  --accent-text: color-mix(in oklch, var(--accent) 84%, black);
  --shadow: 0 1px 2px oklch(0.3 0.02 255 / 0.06), 0 22px 48px -28px oklch(0.3 0.04 255 / 0.28);
  --grain-opacity: 0.02;
  color-scheme: light;
}

/* ---- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: white; }

/* subtle film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Layout helpers ----------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: var(--accent-line);
}
.section-head { margin-bottom: clamp(2rem, 4vw, 3.5rem); max-width: 46ch; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 0.8rem;
  text-wrap: balance;
}
.section-head p { color: var(--text-muted); margin-top: 1rem; font-size: var(--step-1); }

/* Greek meander divider */
.meander {
  height: 14px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='14' viewBox='0 0 56 14'%3E%3Cpath d='M0 13 L0 4 L10 4 L10 10 L4 10 L4 6 M14 13 L14 1 L24 1 L24 13 M20 13 L20 5 L28 5 M28 13 L28 1 L38 1 L38 7 L34 7 M42 13 L42 4 L52 4 L52 10 L46 10 L46 6' fill='none' stroke='%23808080' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.35;
  color: var(--accent);
}
:root[data-meander="off"] .meander { display: none; }

/* ---- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.72em 1.2em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.btn svg { width: 1.05em; height: 1.05em; }
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn--primary:hover { filter: brightness(1.06); border-color: var(--accent); }

/* ---- Header / nav ------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header[data-stuck="true"] { border-bottom-color: var(--border); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
}
.brand .dim { color: var(--text-faint); font-weight: 500; }
.brand .blink { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); }
.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  position: relative;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.22s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-meta { display: flex; align-items: center; gap: 0.6rem; }
.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); transform: rotate(12deg); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-grid; }
  .icon-btn { width: 44px; height: 44px; }
  .nav-links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: color-mix(in oklch, var(--bg) 97%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0.25rem var(--gutter) 1.1rem;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links[data-open="true"] { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { display: block; padding: 0.95rem 0; font-size: 1.05rem; color: var(--text); border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a::after { display: none; }
  .hero-cta .btn { padding-block: 0.9em; }
}

/* ---- Hero --------------------------------------------------- */
.hero { padding-top: clamp(3rem, 8vw, 7rem); padding-bottom: clamp(3rem, 7vw, 6rem); position: relative; overflow: hidden; }
.hero-glow {
  position: absolute;
  top: -30%; right: -10%;
  width: 60vw; height: 60vw;
  max-width: 760px; max-height: 760px;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-loc {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1.5rem;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: oklch(0.72 0.17 150);
  box-shadow: 0 0 0 0 oklch(0.72 0.17 150 / 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.72 0.17 150 / 0.55); }
  70% { box-shadow: 0 0 0 9px oklch(0.72 0.17 150 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.72 0.17 150 / 0); }
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-5);
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero h1 .greek { color: var(--text-faint); font-weight: 500; display: block; font-size: 0.34em; letter-spacing: 0.04em; margin-bottom: 0.6em; font-family: var(--font-mono); }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-role {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--text);
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 0.9em;
  align-items: center;
}
.hero-role .sep { color: var(--accent); }
.hero-bio {
  color: var(--text-muted);
  font-size: var(--step-1);
  max-width: 52ch;
  margin-top: 1.6rem;
  line-height: 1.65;
}
.hero-bio strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.2rem; }

/* portrait */
.portrait-wrap { position: relative; }
.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background:
    repeating-linear-gradient(45deg, var(--surface) 0 12px, var(--surface-2) 12px 24px);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .ph {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-faint);
  text-align: center;
  padding: 1rem;
  line-height: 1.5;
}
.portrait-tag {
  position: absolute;
  bottom: -14px; left: -14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6em 0.9em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  box-shadow: var(--shadow);
  color: var(--text-muted);
}
.portrait-tag b { color: var(--text); }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-wrap { max-width: 320px; }
}

/* ---- Stats marquee band ------------------------------------- */
.stats {
  border-block: 1px solid var(--border);
  background: var(--bg-2);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  padding: clamp(1.6rem, 3vw, 2.6rem) clamp(1rem, 2vw, 1.6rem);
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat .num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-3);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.stat .num span { color: var(--accent); }
.stat .lbl { color: var(--text-muted); font-size: var(--step--1); margin-top: 0.6rem; line-height: 1.4; }
@media (max-width: 680px) {
  .stat:nth-child(even) { border-right: none; }
  .stat { border-bottom: 1px solid var(--border); }
}

/* ---- Work cards --------------------------------------------- */
.work-grid { display: grid; gap: clamp(1.2rem, 2.5vw, 1.8rem); }
.work-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  align-items: start;
  padding: clamp(1.5rem, 3.5vw, 2.6rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.work-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.work-index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent-text);
  padding-top: 0.4rem;
}
.work-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-2);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.work-meta {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 0.8em;
}
.work-meta .role { color: var(--accent-text); }
.work-body p { color: var(--text-muted); margin-top: 1rem; max-width: 62ch; }
.work-body ul { list-style: none; padding: 0; margin-top: 1.1rem; display: grid; gap: 0.55rem; }
.work-body li {
  color: var(--text-muted);
  font-size: var(--step--1);
  padding-left: 1.4em;
  position: relative;
  line-height: 1.55;
}
.work-body li::before {
  content: "▸";
  position: absolute; left: 0;
  color: var(--accent-text);
}
.work-body li b { color: var(--text); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.3rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.35em 0.75em;
  background: var(--bg-2);
}
.work-link {
  align-self: start;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.work-link:hover { background: var(--accent); border-color: var(--accent); color: white; transform: translate(2px, -2px); }
.work-link svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .work-card { grid-template-columns: 1fr; gap: 0.4rem; }
  .work-link { position: absolute; top: 1.5rem; right: 1.5rem; }
}

/* ---- Experience timeline ------------------------------------ */
.timeline { position: relative; display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: clamp(110px, 16vw, 200px) 1fr;
  gap: clamp(1rem, 3vw, 3rem);
  padding-block: clamp(1.4rem, 3vw, 2.2rem);
  border-top: 1px solid var(--border);
  position: relative;
}
.tl-item:hover .tl-when { color: var(--accent-text); }
.tl-when {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-faint);
  transition: color 0.2s ease;
  padding-top: 0.35rem;
}
.tl-body h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em; }
.tl-body .org { color: var(--accent-text); font-family: var(--font-mono); font-size: var(--step--1); margin-top: 0.2rem; }
.tl-body p { color: var(--text-muted); font-size: var(--step--1); margin-top: 0.7rem; max-width: 64ch; line-height: 1.6; }
.tl-roles { list-style: none; padding: 0; margin-top: 0.8rem; display: grid; gap: 0.3rem; }
.tl-roles li { font-size: var(--step--1); color: var(--text-muted); font-family: var(--font-mono); }
.tl-roles li span { color: var(--text-faint); }
@media (max-width: 620px) {
  .tl-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---- Skills ------------------------------------------------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(1rem, 2vw, 1.4rem); }
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 2.5vw, 1.7rem);
  transition: border-color 0.25s ease;
}
.skill-card:hover { border-color: var(--accent-line); }
.skill-card h3 {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1rem;
}
.skill-card h3::before { content: ""; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35em 0.7em;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent-line); transform: translateY(-1px); }

/* ---- Open source -------------------------------------------- */
.oss-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(1rem, 2vw, 1.4rem); }
.oss-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 2.5vw, 1.6rem);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
}
.oss-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.oss-card .repo {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.oss-card .repo svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.oss-card p { color: var(--text-muted); font-size: var(--step--1); line-height: 1.55; flex: 1; }
.oss-card .repo-foot { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); display: flex; align-items: center; gap: 0.5em; }

/* ---- About -------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about-lead { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; text-wrap: pretty; }
.about-lead em { font-style: normal; color: var(--accent); }
.about-grid p { color: var(--text-muted); margin-top: 1.2rem; line-height: 1.7; max-width: 56ch; }
.about-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem);
}
.about-side dl { display: grid; gap: 1.1rem; }
.about-side .row { display: grid; gap: 0.2rem; }
.about-side dt { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.about-side dd { color: var(--text); font-size: var(--step--1); }
.about-side dd a { color: var(--accent-text); border-bottom: 1px solid var(--accent-line); transition: border-color 0.2s; }
.about-side dd a:hover { border-color: var(--accent); }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }

/* ---- Contact ------------------------------------------------ */
.contact { background: var(--bg-2); border-top: 1px solid var(--border); }
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-left h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-3); letter-spacing: -0.025em; line-height: 1.05; text-wrap: balance; }
.contact-left p { color: var(--text-muted); margin-top: 1rem; font-size: var(--step-1); max-width: 38ch; }
.contact-links { display: grid; gap: 0.7rem; margin-top: 2rem; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.9em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-muted);
  padding: 0.6em 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.contact-link:hover { color: var(--text); padding-left: 0.5em; }
.contact-link svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.contact-link .arr { margin-left: auto; opacity: 0; transition: opacity 0.2s ease; }
.contact-link:hover .arr { opacity: 1; }

/* form */
.form { display: grid; gap: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.5rem, 3.5vw, 2.4rem); }
.field { display: grid; gap: 0.45rem; }
.field label { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75em 0.9em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .btn { justify-content: center; padding-block: 0.9em; }
.form-note { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); text-align: center; }
.form-note.ok { color: oklch(0.72 0.16 150); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---- Footer ------------------------------------------------- */
.site-footer { padding-block: 3rem; border-top: 1px solid var(--border); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.footer-grid p { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-faint); }
.footer-grid .heart { color: var(--accent); }
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-text); }

/* ---- Scroll reveal (progressive enhancement) ---------------- */
/* Hidden state only applies once JS confirms it's active; without
   JS (or if it fails) content stays fully visible. */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.js-reveal [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js-reveal [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ---- Tweaks root isolation ---------------------------------- */
#tweaks-root { position: fixed; z-index: 10000; }

/* ---- Cookie consent ----------------------------------------- */
.consent {
  position: fixed;
  z-index: 9000;
  left: 50%;
  bottom: clamp(0.9rem, 3vw, 1.6rem);
  transform: translateX(-50%) translateY(8px);
  width: min(640px, calc(100vw - 2 * clamp(0.9rem, 3vw, 1.6rem)));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.4rem;
  justify-content: space-between;
  background: color-mix(in oklch, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.consent[data-show="true"] { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.consent-text { font-size: var(--step--1); color: var(--text-muted); line-height: 1.5; flex: 1 1 280px; margin: 0; }
.consent-text strong { color: var(--text); font-weight: 600; }
.consent-actions { display: flex; gap: 0.6rem; flex-shrink: 0; }
.consent-actions .btn { padding: 0.6em 1.1em; }
@media (max-width: 520px) {
  .consent { flex-direction: column; align-items: stretch; }
  .consent-actions { justify-content: stretch; }
  .consent-actions .btn { flex: 1; justify-content: center; }
}
