/* =====================================================================
   Luka Barisic — Portfolio
   Dark studio world · one hot accent · CSS-only motion
   (scroll-driven animations where supported, static fallback elsewhere)
   ===================================================================== */

/* ---------- Self-hosted fonts (SIL Open Font License, see /fonts) ----------
   Served from this domain so no visitor data is sent to Google. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('fonts/archivo-latin-ext-wdth-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('fonts/archivo-latin-wdth-normal.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: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geist-latin-ext-wght-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geist-latin-wght-normal.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: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geist-mono-latin-ext-wght-normal.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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/geist-mono-latin-wght-normal.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;
}

/* ---------- Animatable custom properties ---------- */
@property --fill { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
@property --ax   { syntax: '<percentage>'; inherits: false; initial-value: 68%; }
@property --ay   { syntax: '<percentage>'; inherits: false; initial-value: 38%; }

/* ---------- Tokens ---------- */
:root {
  --bg:          #042f32;
  --surface:     #0c3739;
  --surface-2:   #153f40;
  --line:        rgba(240, 235, 225, 0.11);
  --line-strong: rgba(240, 235, 225, 0.24);

  --ink:   #f0ebe1;
  --ink-2: #bdb7ac;
  --ink-3: #8c877e;

  --accent:      #d6ffcb;
  --accent-deep: #4cd787;
  --accent-ink:  #0a2e1d;
  --accent-soft: rgba(214, 255, 203, 0.14);

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body:    'Geist', system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;

  --pad: clamp(1.4rem, 3.2vw, 3rem);
  --max: 1440px;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io:   cubic-bezier(0.65, 0, 0.35, 1);
  --ease-back: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;               /* no sideways scroll on phones (contact glow is wider than the screen) */
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink-2);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, summary { font: inherit; color: inherit; }

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

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

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border: 2px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 200;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* ---------- Film grain ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 150;
  pointer-events: none;
  opacity: 0.06;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-3%, 2%); }
  40%  { transform: translate(2%, -4%); }
  60%  { transform: translate(-4%, -1%); }
  80%  { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* =====================================================================
   NAV — floating pill
   ===================================================================== */
.nav {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  z-index: 100;
  width: min(calc(100% - 2 * var(--pad)), 1100px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.45rem 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 14, 13, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  animation: navIn 1s var(--ease-out) 0.9s both;
}

.nav.is-scrolled {
  background: rgba(15, 14, 13, 0.82);
  border-color: var(--line-strong);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.8);
}

@keyframes navIn {
  from { opacity: 0; transform: translateY(-120%); }
  to   { opacity: 1; transform: none; }
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.nav__mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: -0.02em;
  transition: transform 0.6s var(--ease-back), background 0.3s;
}
.nav__brand:hover .nav__mark { transform: rotate(-360deg); background: var(--accent); }

.nav__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.nav__status-text { display: inline; }
.nav__status em { font-style: normal; }
.nav__status em::before { content: ' · '; }
.nav__status i {
  flex: none;
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}
.nav__status i::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #4ade80;
  animation: ping 2s var(--ease-out) infinite;
}
@keyframes ping {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(3); opacity: 0; }
}

.nav__links {
  display: flex;
  gap: 0.15rem;
  margin-left: auto;
}

.nav__links a {
  position: relative;
  display: block;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.25s, background 0.25s;
}
.nav__links a:hover { color: var(--ink); background: rgba(240, 235, 225, 0.06); }
.nav__links a.active { color: var(--ink); }
.nav__links a.active::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.2rem;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Mobile menu (checkbox hack, no JS) ---------- */
.nav__toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.nav__toggle {
  display: none;
  position: relative;
  z-index: 101;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out), translate 0.35s var(--ease-out);
}
.nav__toggle span:first-child { translate: 0 -3px; }
.nav__toggle span:last-child { translate: 0 3px; }

.nav__toggle-input:checked ~ .nav .nav__toggle span:first-child { translate: 0 0; rotate: 45deg; }
.nav__toggle-input:checked ~ .nav .nav__toggle span:last-child { translate: 0 0; rotate: -45deg; }

/* =====================================================================
   BUTTONS & LINKS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.4s var(--ease-out), background 0.3s, color 0.3s, border-color 0.3s;
}
.btn:active { transform: scale(0.97); }

/* Rolling label: text slides up, duplicate slides in from below */
.btn__label {
  position: relative;
  display: block;
  overflow: hidden;
  line-height: 1.3;
}
.btn__label > span { display: block; transition: transform 0.55s var(--ease-out); }
.btn__label::after {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute;
  left: 0;
  top: 100%;
  transition: transform 0.55s var(--ease-out);
}
.btn:hover .btn__label > span,
.btn:hover .btn__label::after { transform: translateY(-100%); }

.btn--primary { background: var(--accent); color: var(--accent-ink); padding-right: 0.45rem; }
.btn--primary:hover { background: var(--ink); }

.btn__icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--accent-ink);
  color: var(--ink);
  font-size: 0.95rem;
  transition: transform 0.5s var(--ease-back);
}
.btn--primary:hover .btn__icon { transform: translateY(3px) rotate(-8deg); }

.btn--ghost { color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.3rem;
  font-weight: 500;
  color: var(--ink);
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0% 1px,
              linear-gradient(var(--line-strong), var(--line-strong)) no-repeat 0 100% / 100% 1px;
  transition: background-size 0.6s var(--ease-out), color 0.3s;
}
.link-arrow i {
  font-style: normal;
  display: inline-block;
  color: var(--accent);
  transition: transform 0.5s var(--ease-back);
}
.link-arrow:hover { background-size: 100% 1px, 100% 1px; }
.link-arrow:hover i { transform: translate(3px, -3px) rotate(45deg); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  --mx: 70%;
  --my: 40%;
  position: relative;
  min-height: 100svh;
  overflow: clip;
  isolation: isolate;
}

.hero__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Shader-like morphing aura (Unicorn Studio feel, pure CSS) */
.hero__aura {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(closest-side at var(--ax) var(--ay), rgba(214, 255, 203, 0.55), rgba(76, 215, 135, 0.25) 45%, transparent 75%),
    radial-gradient(40% 35% at calc(100% - var(--ax)) calc(100% - var(--ay) + 20%), rgba(225, 255, 190, 0.18), transparent 70%);
  filter: blur(50px) saturate(120%);
  opacity: 0.75;
  animation: aura 18s var(--ease-io) infinite alternate;
}

@keyframes aura {
  0%   { --ax: 70%; --ay: 34%; transform: scale(1) rotate(0deg); }
  35%  { --ax: 58%; --ay: 52%; transform: scale(1.1) rotate(6deg); }
  70%  { --ax: 80%; --ay: 60%; transform: scale(0.95) rotate(-4deg); }
  100% { --ax: 66%; --ay: 28%; transform: scale(1.05) rotate(3deg); }
}

/* Dither dot-grid that lights up around the cursor (--mx/--my set by animations.js) */
.hero__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(240, 235, 225, 0.5) 1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(360px circle at var(--mx) var(--my), #000 0%, rgba(0,0,0,0.25) 45%, transparent 80%);
          mask-image: radial-gradient(360px circle at var(--mx) var(--my), #000 0%, rgba(0,0,0,0.25) 45%, transparent 80%);
  opacity: 0.55;
}

.hero__inner {
  --t: clamp(3.6rem, 15.4vw, 15.5rem);   /* title size; portrait scales with it */
  position: relative;
  max-width: var(--max);
  min-height: 100svh;
  margin: 0 auto;
  padding: 6.5rem var(--pad) 2.2rem;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  transform-origin: 50% 0%;
}

.hero__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  animation: fadeUp 1s var(--ease-out) 0.2s both;
}

.hero__hi {
  margin-top: clamp(1.5rem, 5vh, 3.5rem);
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.1vw, 1rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  animation: fadeUp 1s var(--ease-out) 0.3s both;
}

.hero__title {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: var(--t);
  line-height: 0.86;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--ink);
  mix-blend-mode: difference;     /* letters invert where they cross the portrait */
  pointer-events: none;
}

.hero__line {
  display: block;
  white-space: nowrap;
  overflow: clip;
  padding-top: 0.06em;
  margin-top: -0.06em;
}
.hero__line--2 { text-align: right; }

.ch {
  display: inline-block;
  animation: chIn 1.25s var(--ease-out) calc(0.35s + var(--i) * 0.055s) both;
}

@keyframes chIn {
  from { transform: translateY(105%) rotate(8deg); }
  to   { transform: none; }
}

/* ---------- Portrait slot ---------- */
.portrait {
  position: absolute;
  z-index: 1;
  right: calc(var(--pad) + var(--t) * 0.35);
  top: calc(6.5rem + 3.2rem + clamp(1.5rem, 5vh, 3.5rem));
  width: calc(var(--t) * 1.28);
  animation: portraitIn 1.4s var(--ease-out) 0.7s both;
}

@keyframes portraitIn {
  from { clip-path: inset(100% 0 0 0); transform: translateY(40px) rotate(-3deg); }
  to   { clip-path: inset(-20% -20% -20% -20%); transform: rotate(2.5deg); }
}

.portrait__card {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(15, 14, 13, 0.6);
  transition: transform 0.2s var(--ease-out);
  will-change: transform;
}

/* Placeholder — visible until pictures/portrait.jpg exists */
.portrait__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(214, 255, 203, 0.28), transparent 60%),
    repeating-linear-gradient(0deg, rgba(240, 235, 225, 0.05) 0 1px, transparent 1px 4px),
    var(--surface);
}
.portrait__placeholder::before {           /* head-and-shoulders silhouette */
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6%;
  width: 78%;
  aspect-ratio: 1;
  translate: -50% 0;
  background:
    radial-gradient(circle at 50% 28%, rgba(240, 235, 225, 0.1) 0 19%, transparent 19.5%),
    radial-gradient(ellipse 50% 42% at 50% 100%, rgba(240, 235, 225, 0.1) 0 99%, transparent 100%);
}
.portrait__initials {
  position: relative;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: calc(var(--t) * 0.52);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 235, 225, 0.35);
}
.portrait__hint {
  position: absolute;
  left: 0.9rem;
  bottom: 0.8rem;
  font-size: 0.65rem;
  color: var(--ink-3);
}

.portrait__photo {
  position: absolute;
  inset: 0;
  background: url("pictures/portrait.jpg") center 22% / cover no-repeat;
  filter: grayscale(1) contrast(1.08) brightness(0.95);
  transform: scale(1.04);
  transition: filter 0.8s var(--ease-out), transform 1.2s var(--ease-out);
}
.portrait__card:hover .portrait__photo { filter: grayscale(0) contrast(1); transform: scale(1); }

.portrait__scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(214, 255, 203, 0.22) 48%, rgba(214, 255, 203, 0.5) 50%, transparent 52%);
  background-size: 100% 220%;
  mix-blend-mode: screen;
  animation: scan 5.5s var(--ease-io) infinite;
}
@keyframes scan {
  0%   { background-position: 0 120%; }
  60%, 100% { background-position: 0 -120%; }
}

.portrait__corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--accent);
  pointer-events: none;
}
.portrait__corner--tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.portrait__corner--br { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }

.portrait__caption {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.65rem;
  color: var(--ink-3);
}

.portrait__badge {
  position: absolute;
  top: -12%;
  left: -16%;
  width: clamp(84px, calc(var(--t) * 0.62), 140px);
  aspect-ratio: 1;
  z-index: 3;
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 9.6px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  border-radius: 50%;
  fill: var(--accent-ink);
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero bottom ---------- */
.hero__bottom {
  margin-top: auto;
  padding-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.75rem;
  max-width: 34rem;
  animation: fadeUp 1s var(--ease-out) 1s both;
}

.hero__sub {
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.hero__scroll {
  position: absolute;
  right: var(--pad);
  bottom: 2.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink-3);
  animation: fadeUp 1s var(--ease-out) 1.2s both;
}
.hero__scroll i {
  position: relative;
  width: 1px;
  height: 3.2rem;
  background: var(--line-strong);
  overflow: hidden;
}
.hero__scroll i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: drip 2.2s var(--ease-io) infinite;
}
@keyframes drip {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100%); }
}

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

/* =====================================================================
   SKILLS MARQUEE
   ===================================================================== */
.skills {
  padding: clamp(3rem, 7vw, 6rem) 0;
  border-block: 1px solid var(--line);
  overflow: clip;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
}

.skills__row {
  display: flex;
  width: max-content;
  font-size: clamp(2.2rem, 6.2vw, 5.6rem);
  color: var(--ink);
}
.skills__row + .skills__row { margin-top: 0.12em; }

.skills__row--reverse {
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 235, 225, 0.4);
  font-stretch: 62%;
}

.skills__track {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding-right: 0.45em;
  flex-shrink: 0;
  animation: marquee 38s linear infinite;
}
.skills__row--reverse .skills__track { animation-direction: reverse; animation-duration: 46s; }

.skills__track i {
  font-style: normal;
  font-size: 0.45em;
  color: var(--accent);
  -webkit-text-stroke: 0;
}
.skills__row--reverse .skills__track i { color: var(--ink-3); font-size: 0.8em; }

.skills:hover .skills__track { animation-play-state: paused; }

@keyframes marquee {
  to { transform: translateX(-100%); }
}

/* =====================================================================
   ABOUT STORY
   ===================================================================== */
.about-story {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) var(--pad) clamp(5rem, 11vw, 10rem);
}

.about-story__body {
  display: grid;
  grid-template-columns: minmax(0, 42rem) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.about-story__lead {
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.6;
  color: var(--ink-2);
}

.about-story__stats {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.2rem);
}

.about-story__stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.about-story__stat:first-child { padding-top: 0; border-top: none; }

.about-story__stat-value {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--accent);
}

.about-story__stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* =====================================================================
   SECTION HEAD (shared)
   ===================================================================== */
.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem 2rem;
  padding-bottom: 1.5rem;
  margin-bottom: clamp(3rem, 8vw, 7rem);
  border-bottom: 1px solid var(--line);
}

.section-eyebrow {
  grid-column: 1 / -1;
  color: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(2.6rem, 8.2vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.section-title em {
  display: block;
  font-style: normal;
  font-stretch: 62%;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.section-count { color: var(--ink-3); padding-bottom: 0.5rem; }

/* =====================================================================
   PROJECTS
   ===================================================================== */
.projects {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 10rem) var(--pad);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: clamp(6rem, 13vw, 11rem);
}

.project {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
  align-items: center;
}

.project__media   { grid-column: 1 / span 7; }
.project__content { grid-column: 9 / span 4; }

.project--reverse .project__media   { grid-column: 6 / span 7; grid-row: 1; }
.project--reverse .project__content { grid-column: 1 / span 4; grid-row: 1; }

.project__frame {
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.4s, transform 0.6s var(--ease-out);
}
.project:hover .project__frame { border-color: var(--line-strong); }

.project__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.project__bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  transition: background 0.3s;
}
.project:hover .project__bar i:first-child { background: var(--accent); border-color: var(--accent); }
.project__bar span {
  margin-left: 0.6rem;
  font-size: 0.66rem;
  color: var(--ink-3);
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project__shot {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.project__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.2s var(--ease-out);
}
.project:hover .project__shot img { transform: scale(1.04); }

.project__meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.project__num {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(3rem, 5vw, 4.6rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  transition: color 0.5s;
}
.project:hover .project__num { color: var(--accent); }

.project__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.tag {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.project__title {
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 700;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

.project__desc {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 1.6rem;
  text-wrap: pretty;
}

/* Demo logins (collapsible) */
.project__credentials {
  margin-bottom: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(240, 235, 225, 0.02);
}
.project__credentials summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--ink-2);
}
.project__credentials summary::-webkit-details-marker { display: none; }
.project__credentials summary::after {
  content: '+';
  font-size: 1rem;
  color: var(--accent);
  transition: transform 0.4s var(--ease-out);
}
.project__credentials[open] summary::after { transform: rotate(45deg); }
.project__credentials summary:hover { color: var(--ink); }

.project__credentials dl {
  padding: 0 1rem 0.9rem;
  display: grid;
  gap: 0.45rem;
}
.project__credentials dl > div {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  gap: 0.75rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}
.project__credentials dt { color: var(--ink-3); text-transform: uppercase; }
.project__credentials dd { color: var(--ink); overflow-wrap: anywhere; }
.project__credentials dd:last-child { color: var(--accent); }

/* =====================================================================
   SERVICES — numbered rows
   ===================================================================== */
.services {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 7rem) var(--pad) clamp(5rem, 11vw, 10rem);
}

.service-list { border-bottom: 1px solid var(--line); }

.service { border-top: 1px solid var(--line); }
.service:first-child { border-top: 0; }

.service__link {
  position: relative;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1.2fr) minmax(0, 1fr) 3rem;
  align-items: center;
  gap: 2rem;
  padding: clamp(1.6rem, 3vw, 2.6rem) 1rem;
  isolation: isolate;
  overflow: hidden;
}

.service__link::before {                 /* accent sweep */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.6s var(--ease-out);
}
.service__link:hover::before,
.service__link:focus-visible::before { clip-path: inset(0 0 0 0); }

.service__num { color: var(--ink-3); transition: color 0.4s; }

.service__title {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.4s, transform 0.6s var(--ease-out);
}

.service__desc {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-2);
  transition: color 0.4s;
}

.service__arrow {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: transform 0.6s var(--ease-back), background 0.4s, color 0.4s, border-color 0.4s;
}

.service__link:hover .service__num,
.service__link:hover .service__title,
.service__link:hover .service__desc { color: var(--accent-ink); }
.service__link:hover .service__title { transform: translateX(0.6rem); }
.service__link:hover .service__arrow {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--ink);
  transform: rotate(-45deg);
}

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 9rem) var(--pad) clamp(4rem, 8vw, 7rem);
  isolation: isolate;
}

.contact__aura {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 30%;
  width: min(1100px, 120vw);
  aspect-ratio: 2 / 1;
  translate: -50% 0;
  background: radial-gradient(closest-side, rgba(214, 255, 203, 0.22), transparent);
  filter: blur(40px);
  pointer-events: none;
}

.contact .section-eyebrow { display: block; margin-bottom: 1.5rem; }

.contact__title {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(3rem, 11.5vw, 11.5rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.contact__line { display: block; }

/* Text fills with accent as it scrolls into view */
.contact__line--fill {
  text-align: right;
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 235, 225, 0.45);
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 0 / var(--fill) 100%;
  -webkit-background-clip: text;
          background-clip: text;
}

.contact__sub {
  max-width: 30rem;
  font-size: 1.05rem;
  color: var(--ink-2);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.contact__links { border-top: 1px solid var(--line); }
.contact__links li { border-bottom: 1px solid var(--line); }

.contact__link {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.2rem, 2.4vw, 2rem) 0;
}

.contact__label { color: var(--ink-3); }

.contact__value {
  font-family: var(--font-display);
  font-stretch: 100%;
  font-weight: 600;
  font-size: clamp(1.25rem, 3.4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  overflow-wrap: anywhere;
  transition: color 0.35s, transform 0.6s var(--ease-out);
}

.contact__arrow {
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  color: var(--ink-3);
  transition: transform 0.6s var(--ease-back), color 0.35s;
}

.contact__link:hover .contact__value { color: var(--accent); transform: translateX(1rem); }
.contact__link:hover .contact__arrow { color: var(--accent); transform: rotate(45deg); }

.contact__link--static { cursor: default; }
.contact__link--static:hover .contact__value { color: var(--ink); transform: none; }

.contact__value--lang {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* =====================================================================
   LEGAL (Impressum)
   ===================================================================== */
.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(7rem, 14vw, 11rem) var(--pad) clamp(5rem, 8vw, 7rem);
}

.legal .section-title { font-size: clamp(2.4rem, 6.5vw, 4.5rem); margin-bottom: 1.6rem; }
/* longer legal titles (e.g. "Datenschutz") need a smaller size to fit the column */
.legal .section-title--long { font-size: clamp(1.6rem, 8.2vw, 3.5rem); }

.legal__intro {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  background: var(--surface);
}
.legal__intro strong { color: var(--ink-2); }

.legal__block { padding: 1.8rem 0; border-top: 1px solid var(--line); }
.legal__block:first-of-type { border-top: none; padding-top: 0; }

.legal__block h3 {
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.legal__block p { margin-bottom: 0.9rem; max-width: 42rem; font-size: 0.95rem; }
.legal__block p:last-child { margin-bottom: 0; }

.legal__field { color: var(--ink); }
.legal__placeholder { color: var(--accent); font-style: italic; }

.legal a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color 0.25s; }
.legal a:hover { color: var(--accent); }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer {
  overflow: clip;
  border-top: 1px solid var(--line);
}

.footer__row {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.6rem var(--pad);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-3);
}
.footer__top { color: var(--ink-2); transition: color 0.25s; }
.footer__top:hover { color: var(--accent); }

.footer__wordmark {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 18.5vw;               /* "BARISIC" is ~4.98em wide, so this leaves ~4% margin each side */
  line-height: 0.74;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  text-align: center;
  color: var(--surface-2);
  margin-bottom: -0.05em;
  user-select: none;
  pointer-events: none;
}

/* =====================================================================
   SCROLL-DRIVEN MOTION (Chrome / Edge / Safari 26+; static elsewhere)
   ===================================================================== */
@supports (animation-timeline: view()) {

  .progress {
    animation: progress linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progress { to { transform: scaleX(1); } }

  /* Hero recedes as you scroll away */
  .hero__inner {
    animation: heroOut linear both;
    animation-timeline: view();
    animation-range: exit 0% exit 100%;
  }
  @keyframes heroOut {
    to { transform: translateY(12%) scale(0.94); opacity: 0.15; filter: blur(4px); }
  }

  /* Marquee rows drift sideways with scroll on top of their loop */
  .skills__row {
    animation: drift linear both;
    animation-timeline: view();
  }
  .skills__row--reverse { animation-name: driftBack; }
  @keyframes drift     { from { translate: 8% 0; }  to { translate: -8% 0; } }
  @keyframes driftBack { from { translate: -14% 0; } to { translate: 2% 0; } }

  /* Section titles wipe up */
  .section-title {
    animation: wipeUp linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 35%;
  }
  @keyframes wipeUp {
    from { clip-path: inset(0 0 100% 0); transform: translateY(0.3em); }
    to   { clip-path: inset(0 0 -10% 0); transform: none; }
  }

  /* Project screenshots open like a shutter, image parallaxes inside */
  .project__media {
    animation: shutter linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }
  @keyframes shutter {
    from { clip-path: inset(18% 14% 18% 14% round 16px); transform: scale(0.94) translateY(6%); }
    to   { clip-path: inset(0 0 0 0 round 16px); transform: none; }
  }

  .project__shot img {
    height: 118%;
    animation: parallax linear both;
    animation-timeline: view();
  }
  .project:hover .project__shot img { transform: none; }
  @keyframes parallax {
    from { translate: 0 0; }
    to   { translate: 0 -15%; }
  }

  .project__content {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 35%;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(60px); }
    to   { opacity: 1; transform: none; }
  }

  /* Service rows slide in one by one */
  .service {
    animation: rowIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
  @keyframes rowIn {
    from { opacity: 0; transform: translateX(-4%); }
    to   { opacity: 1; transform: none; }
  }

  /* "together" fills with accent */
  .contact__line--fill {
    animation: fill linear both;
    animation-timeline: view();
    animation-range: entry 20% cover 55%;
  }
  @keyframes fill {
    from { --fill: 0%; }
    to   { --fill: 100%; }
  }

  .contact__line:first-child {
    animation: slideIn linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }
  @keyframes slideIn {
    from { transform: translateX(-12%); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }

  /* Giant footer wordmark rises from the floor */
  .footer__wordmark {
    animation: floorRise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
  @keyframes floorRise {
    from { transform: translateY(45%); color: var(--bg); }
    to   { transform: none; }
  }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  .project__media,
  .project--reverse .project__media { grid-column: 1 / -1; grid-row: auto; }
  .project__content,
  .project--reverse .project__content { grid-column: 1 / span 9; grid-row: auto; }

  .service__link { grid-template-columns: 3rem 1fr 2.8rem; }
  .service__desc { grid-column: 2; grid-row: 2; }
  .service__arrow { grid-column: 3; grid-row: 1; }
}

@media (max-width: 860px) {
  .nav__toggle { display: flex; margin-left: auto; }

  .nav__links {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: rgba(15, 14, 13, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
  }
  .nav__toggle-input:checked ~ .nav .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__links a {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    font-family: var(--font-display);
    font-stretch: 112%;
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: -0.01em;
  }
  .nav__links a::before { display: none; }
  .nav__links a:hover { background: rgba(240, 235, 225, 0.06); }

  /* title size is derived from the available width so "BARISIC" always fits on one row */
  .hero__inner { --t: clamp(2.6rem, calc((100vw - 2 * var(--pad)) / 5.3), 9rem); padding-top: 5.5rem; }
  .hero__meta-right { display: none; }

  .portrait {
    position: relative;
    top: auto;
    right: auto;
    width: min(62%, 300px);
    margin: 1.4rem 1.5rem 0 auto;
  }
  .portrait__badge { left: -18%; top: -8%; }

  .hero__title { mix-blend-mode: normal; }
  .hero__bottom { padding-top: 2.5rem; max-width: none; }
  .hero__scroll { display: none; }

  /* single column on phones: 12 tracks + 11 gaps (352px) were wider than the card */
  .project { grid-template-columns: minmax(0, 1fr); }
  .project__media,
  .project--reverse .project__media,
  .project__content,
  .project--reverse .project__content { grid-column: 1 / -1; }

  .section-head { grid-template-columns: 1fr; }
  .section-count { display: none; }

  .about-story__body { grid-template-columns: 1fr; }
  .about-story__stats { flex-direction: row; flex-wrap: wrap; gap: 1.5rem 2.5rem; }
  .about-story__stat { padding-top: 0; border-top: none; }

  .contact__link { grid-template-columns: 1fr auto; gap: 0.25rem 1rem; }
  .contact__label { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  /* status stays visible on phones, stacked in two short lines */
  .nav__status { gap: 0.55rem; font-size: 0.6rem; letter-spacing: 0.05em; }
  .nav__status-text { display: flex; flex-direction: column; line-height: 1.3; }
  .nav__status em { color: var(--accent); }
  .nav__status em::before { content: none; }

  .btn { width: 100%; justify-content: space-between; }
  .btn--ghost { justify-content: center; }
  .hero__actions { width: 100%; }

  .service__link { grid-template-columns: 1fr 2.6rem; gap: 0.75rem 1rem; padding-inline: 0.25rem; }
  .service__num { grid-column: 1 / -1; }
  .service__title { grid-column: 1; grid-row: 2; }
  .service__arrow { grid-column: 2; grid-row: 2; width: 2.4rem; height: 2.4rem; }
  .service__desc { grid-column: 1 / -1; grid-row: 3; }

  .project__meta { flex-direction: column; align-items: flex-start; }
  .project__tags { justify-content: flex-start; }
  .project__credentials dl > div { grid-template-columns: 1fr auto; }
  .project__credentials dt { grid-column: 1 / -1; }

  .footer__row { flex-direction: column; }
}

/* =====================================================================
   REDUCED MOTION — everything visible, nothing moves
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .grain { display: none; }
  .progress { display: none; }
  .portrait { transform: rotate(2.5deg); }
}
