/* rechlins.net
   ------------------------------------------------------------------
   Scrubs blue, pearl white type, one champagne accent. Flat: hard edges, no
   borders, square marks, no gradients, glows or shadows. The home page has
   five blocks: hero, EY-LO, the project cards, four links as home-screen
   icons, footer. Project pages, Impressum and 404 follow below.

   TYPE: Outfit (round, geometric) for everything, Libre Bodoni italic
   for the one accent word, Archivo Black only inside the EY-LO panel. Self-hosted (SIL OFL), no
   external requests anywhere.

   MOTION: lines rise once, sections fade in, the logos build themselves,
   the renders float, the coffee steams. Nothing follows the pointer.
   `prefers-reduced-motion` switches all of it off and shows the page fully
   rendered, no intro.
   ------------------------------------------------------------------ */

@font-face { font-family: "Outfit"; src: url("assets/fonts/outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Archivo Black"; src: url("assets/fonts/archivo-black.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Bodoni"; src: url("assets/fonts/libre-bodoni-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #2f4d80;                 /* the blue of the scrubs in the avatar, so figure and page melt together */
  --bg-deep: #24406e;
  --bg-card: #283f6b;
  --text: #FCFBFB;
  --text-2: rgba(252, 251, 251, .78);
  --text-3: rgba(252, 251, 251, .55);
  --line: rgba(252, 251, 251, .18);
  --line-2: rgba(252, 251, 251, .38);
  --accent: #F7D794;              /* champagne */

  --display: "Outfit", "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Outfit", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --serif: "Libre Bodoni", Georgia, "Times New Roman", serif;

  --fs-body: clamp(17px, 1rem + .25vw, 19px);
  --fs-lead: clamp(20px, 1.05rem + .8vw, 27px);
  --fs-hero: clamp(58px, 4vw + 4.6vh + 1rem, 150px);

  --wrap: 1320px;
  --gutter: clamp(18px, 4.5vw, 64px);
  --header-h: 72px;
  --radius: 32px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --dur: 220ms;
  --dur-slow: 900ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-weight: 400; font-size: var(--fs-body); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; font-family: var(--display); font-weight: 500; letter-spacing: -.03em; line-height: 1; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
::selection { background: var(--accent); color: var(--bg); }
:target { scroll-margin-top: calc(var(--header-h) + 24px); }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--text); color: var(--bg); border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Intro ---------- */
.intro { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; transition: transform 1000ms var(--ease-io), visibility 0s linear 1000ms; }
.intro-word { font-family: var(--display); font-size: clamp(38px, 6vw, 96px); font-weight: 500; letter-spacing: -.04em; overflow: hidden; line-height: 1.1; padding: 0 .1em; }
.intro-letters { display: inline-block; transform: translateY(110%); animation: rise 900ms var(--ease) 150ms forwards; }
.intro-letters em { color: var(--accent); font-family: var(--display); font-style: normal; }
html.intro-done .intro { transform: translateY(-100%); visibility: hidden; }
html.no-intro .intro { display: none; }
@keyframes rise { to { transform: translateY(0); } }

.hero .line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.hero .line > span { display: block; transform: translateY(112%); transition: transform 1100ms var(--ease); }
.hero-title .word { display: inline-block; }
html.ready .hero .line > span { transform: translateY(0); }
html.ready .hero-title .line:nth-child(1) > span { transition-delay: 150ms; }
html.ready .hero-title .line:nth-child(2) > span { transition-delay: 250ms; }
html.ready .hero-title .line:nth-child(3) > span { transition-delay: 350ms; }
html.ready .hero-title .line:nth-child(4) > span { transition-delay: 450ms; }
html.ready .hero-sub .line:nth-child(1) > span { transition-delay: 600ms; }
html.ready .hero-sub .line:nth-child(2) > span { transition-delay: 670ms; }
.hero-figure, .site-header { opacity: 0; }
.hero-figure { transition: opacity 900ms var(--ease); }
html.ready .hero-figure { opacity: 1; transition-delay: 450ms; }
html.ready .site-header { opacity: 1; transition-delay: 700ms; }
html:not(.js) .hero .line > span, html:not(.js) .hero-figure, html:not(.js) .site-header { transform: none; opacity: 1; }
html:not(.js) .intro { display: none; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 60; height: var(--header-h); display: flex; align-items: center; transition: background 400ms, opacity 900ms var(--ease); }
.site-header.is-scrolled { background: var(--bg); }
.header-row { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 500; letter-spacing: -.02em; font-size: 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 4px; transition: transform 400ms var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand em, .footer-brand em { color: var(--accent); font-family: var(--display); font-style: normal; }
/* Buy me a coffee, small and always there at the top right: steaming cup, the label from tablet width on */
.head-coffee { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; font-size: 14px; font-weight: 500; letter-spacing: -.01em; color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--line); transition: background 120ms steps(1), color 120ms steps(1), box-shadow 120ms steps(1); }
.head-coffee .cup { width: 22px; height: 22px; margin-top: -5px; color: #FFDD00; stroke-width: 3.6; transform-origin: 50% 85%; animation: cup-wobble 6s ease-in-out 3s infinite; }
.head-coffee:hover { background: #FFDD00; color: #1a1200; box-shadow: none; }
.head-coffee:hover .cup { color: #1a1200; }
.head-coffee:hover .cup .steam path { animation-duration: 1.4s; }
@media (max-width: 640px) { .head-coffee { width: 38px; padding: 0; justify-content: center; } .head-coffee span { display: none; } }

/* ---------- Coffee cup with steam ---------- */
.cup { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.cup .steam path { stroke-width: 2.6; opacity: 0; transform-origin: 50% 100%; animation: steam 2.6s ease-in-out infinite; }
.cup .steam path:nth-child(2) { animation-delay: .5s; }
.cup .steam path:nth-child(3) { animation-delay: 1s; }
@keyframes steam {
  0% { opacity: 0; transform: translateY(4px) scaleY(.7); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-9px) scaleY(1.25); }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; border-radius: 12px; font-weight: 500; font-size: 16px; letter-spacing: -.01em; transition: color 350ms var(--ease); }
.btn svg { transition: transform 400ms var(--ease); }
.btn-primary { background: var(--text); color: var(--bg); transition: background 120ms steps(1); }
.btn-primary:hover { background: var(--accent); color: var(--bg); }
.btn-primary:hover svg { transform: translate(2px, -2px); }
.btn-ghost { color: var(--text); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-ghost:hover { color: var(--accent); }
.btn-ghost:hover svg { transform: translate(2px, -2px); }
/* Buy me a coffee: in the service's yellow, the cup steams and wobbles now and then */
.btn-coffee { background: #FFDD00; color: #1a1200; gap: 12px; padding-left: 22px; transition: background 120ms steps(1); }
.btn-coffee:hover { background: var(--text); color: #1a1200; }
.btn-coffee .cup { width: 26px; height: 26px; margin-top: -6px; stroke-width: 3.6; transform-origin: 50% 85%; animation: cup-wobble 5s ease-in-out 1.5s infinite; }
.btn-coffee:hover .cup { animation-duration: 1.6s; }
.btn-coffee:hover .cup .steam path { animation-duration: 1.4s; }
@keyframes cup-wobble {
  0%, 78%, 100% { transform: none; }
  82% { transform: rotate(-12deg) translateY(-2px); }
  86% { transform: rotate(9deg) translateY(-1px); }
  90% { transform: rotate(-5deg); }
  94% { transform: rotate(2deg); }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; padding: calc(var(--header-h) + 4vh) var(--gutter) 8vh; max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 32px; }
.hero-title { font-size: var(--fs-hero); font-weight: 500; letter-spacing: -.04em; line-height: .94; }
.hero-title i { font-style: normal; color: transparent; position: relative; }
.hero-title i::after { content: ""; position: absolute; left: .08em; bottom: .14em; width: .17em; height: .17em; background: var(--accent); }
.word-accent { color: var(--accent); }
.hero-sub { margin-top: 40px; max-width: 34ch; font-size: var(--fs-lead); color: var(--text-2); line-height: 1.35; letter-spacing: -.01em; }
/* the figure sits just above the EY-LO panel, its cut-off bottom edge parallel to the panel top */
.hero-figure { position: relative; aspect-ratio: 1; width: min(100%, 560px); justify-self: end; align-self: end; margin-bottom: calc(32px - 8vh); }
.figure-still, .figure-video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the clip lies on top of the still and takes over with its first frame (main.js sets is-playing) */
.figure-video { position: absolute; inset: 0; opacity: 0; }
.hero-figure.is-playing .figure-video { opacity: 1; }
.hero-figure.is-playing .figure-still { visibility: hidden; }

/* ---------- EY-LO: dark, white mark, amber dot; the mark redraws itself ---------- */
.eylo { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 8vh; --ey-amber: #F7D794; }
.eylo-panel { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-card); color: var(--text);
  padding: clamp(48px, 8vw, 110px) clamp(28px, 6vw, 96px); text-align: center; transition: background 120ms steps(1); }
.eylo-panel:hover { background: var(--bg-deep); }
.eylo-content { position: relative; display: flex; flex-direction: column; align-items: center; }
.eylo-brand { display: inline-flex; align-items: center; gap: clamp(12px, 1.6vw, 22px); margin-bottom: clamp(28px, 4vw, 48px); }
.eylo-mark { width: clamp(64px, 9vw, 120px); height: auto; color: var(--text); overflow: visible; }
.eylo-word { font-family: "Archivo Black", "Archivo", Impact, sans-serif; font-size: clamp(44px, 7vw, 104px); letter-spacing: -.04em; line-height: 1; color: var(--text); }
.eylo-claim { font-family: "Archivo Black", "Archivo", Impact, sans-serif; font-size: clamp(24px, 1.1rem + 1.9vw, 46px); letter-spacing: -.02em; line-height: 1.08; max-width: 22ch; text-wrap: balance; }
.eylo-claim i { font-style: normal; color: transparent; position: relative; }
.eylo-claim i::after { content: ""; position: absolute; left: .1em; bottom: .12em; width: .22em; height: .22em; background: var(--ey-amber); }
.eylo-cta { display: inline-flex; align-items: center; gap: 10px; margin-top: clamp(28px, 4vw, 44px); padding: 16px 28px; border-radius: 12px; background: var(--text); color: var(--bg);
  font-family: "Archivo Black", "Archivo", sans-serif; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; transition: background 120ms steps(1); }
.eylo-panel:hover .eylo-cta { background: var(--ey-amber); color: var(--bg); }

/* 1. the mark draws itself when it scrolls into view (same timing as ey-lo.com),
   2. then it keeps undrawing and redrawing itself: each part on its own odd
      cycle with uneven pauses, so the rhythm never quite repeats */
.eylo-mark .mark-ring { stroke-dasharray: 340; stroke-dashoffset: 340; }
.eylo-mark .mark-ring--small { stroke-dasharray: 210; stroke-dashoffset: 210; }
.eylo-mark .mark-dot { transform-box: fill-box; transform-origin: center; transform: scale(0); opacity: 0; }
.eylo-mark.go .mark-ring { animation: draw 1.1s cubic-bezier(.4, 0, .2, 1) forwards, redraw-a 46s cubic-bezier(.4, 0, .2, 1) 3s infinite; }
.eylo-mark.go .mark-ring--small { animation: draw 1.1s cubic-bezier(.4, 0, .2, 1) .18s forwards, redraw-b 58s cubic-bezier(.4, 0, .2, 1) 5s infinite; }
.eylo-mark.go .mark-dot { animation: mark-dot-in .5s cubic-bezier(.34, 1.56, .64, 1) .95s forwards, redraw-c 37s cubic-bezier(.34, 1.56, .64, 1) 7s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes mark-dot-in { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
/* big ring: undraw at 31 %, hold, redraw at 46 %; a second short one late in the cycle */
@keyframes redraw-a {
  0%, 31%   { stroke-dashoffset: 0; }
  40%       { stroke-dashoffset: 340; }
  46%       { stroke-dashoffset: 340; }
  55%, 79%  { stroke-dashoffset: 0; }
  84%       { stroke-dashoffset: 340; }
  91%, 100% { stroke-dashoffset: 0; }
}
/* small ring: different cycle, undraws while the big one is drawn and vice versa */
@keyframes redraw-b {
  0%, 18%   { stroke-dashoffset: 0; }
  25%       { stroke-dashoffset: 210; }
  33%       { stroke-dashoffset: 210; }
  41%, 62%  { stroke-dashoffset: 0; }
  67%       { stroke-dashoffset: 210; }
  75%, 100% { stroke-dashoffset: 0; }
}
/* dot: pops away and back, now and then */
@keyframes redraw-c {
  0%, 27%   { transform: scale(1); opacity: 1; }
  31%       { transform: scale(0); opacity: 0; }
  38%       { transform: scale(0); opacity: 0; }
  43%       { transform: scale(1.15); opacity: 1; }
  46%, 71%  { transform: scale(1); opacity: 1; }
  74%       { transform: scale(0); opacity: 0; }
  79%       { transform: scale(0); opacity: 0; }
  84%       { transform: scale(1.15); opacity: 1; }
  87%, 100% { transform: scale(1); opacity: 1; }
}
html:not(.js) .eylo-mark .mark-ring { stroke-dashoffset: 0; }
html:not(.js) .eylo-mark .mark-dot { transform: none; opacity: 1; }

/* ---------- Work: the project cards, two side by side ---------- */
.work { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 10vh; }
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { position: relative; overflow: hidden; border-radius: var(--radius); color: inherit;
  background: var(--bg-card); padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; transition: background 120ms steps(1); }
.card:hover { background: var(--bg-deep); }
.card-media { position: relative; display: grid; place-items: center; height: clamp(300px, 28vw, 420px); margin-bottom: 32px; }
.card-title { font-size: clamp(30px, 1.4rem + 1.4vw, 44px); }
.card-desc { margin: 14px 0 26px; color: var(--text-2); max-width: 40ch; }
.card .btn { align-self: flex-start; margin-top: auto; }
/* App Store badge: Apple's own asset, unchanged, in place of a button (min. 40px high per Apple) */
.app-store { display: inline-flex; align-self: flex-start; }
.app-store img { display: block; height: 56px; width: auto; }
/* eduModel: last, across the full width, model left, text right */
.card-edu { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; column-gap: clamp(24px, 4vw, 64px); align-items: start; }
.card-edu .card-media { grid-row: 1 / 4; margin-bottom: 0; }
.card-edu .card-title { align-self: end; padding-top: clamp(24px, 6vw, 96px); }
.card-edu .btn { align-self: start; }
.float { position: relative; width: min(100%, 330px); }
.float.float-wide { width: min(100%, 440px); }
.float-wide img { width: 100%; height: auto; }
.float.float-duo { width: min(100%, 580px); }
/* ProsthoBro: app icon, the iPad view a bit smaller next to it */
.pb-media { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 40px); width: 100%; }
.float.app-shot { width: clamp(100px, 28%, 150px); }
.float.app-shot--wide { width: clamp(150px, 46%, 260px); }
.app-shot img { width: 100%; height: auto; }
.app-shot--wide img { border-radius: 8px; }
/* ProsthoBro icon: tooth and fist as two layers, the fist punches out once */
.pb-icon { position: relative; flex: none; width: clamp(120px, 38%, 210px); aspect-ratio: 1; border-radius: 22%; background: #FCFBFB; }
.pb-icon img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pb-fist { transform-origin: 66% 44%; }
.js .pb-icon { transform: scale(.6); opacity: 0; }
.pb-icon.go { animation: icon-pop .6s cubic-bezier(.34, 1.56, .64, 1) .15s forwards; }
.pb-icon.go .pb-fist { animation: bro-fist 1.1s cubic-bezier(.3, 0, .2, 1) .95s both; }
@keyframes icon-pop { to { transform: none; opacity: 1; } }
@keyframes bro-fist {
  0% { transform: none; }
  18% { transform: scale(.88) rotate(4deg); }           /* ausholen */
  42% { transform: scale(1.55) rotate(-6deg); }         /* Faust kommt auf dich zu */
  62% { transform: scale(1.45) rotate(-4deg); }
  82% { transform: scale(.96); }
  100% { transform: none; }
}
/* ScanSurgeon mark: tile, arcs, cut, one after another */
.ss-logo { flex: none; width: clamp(120px, 38%, 210px); height: auto; overflow: visible; }
.ss-arc, .ss-cut { stroke-dasharray: 1; stroke-dashoffset: 0; }
.ss-tile { transform-box: fill-box; transform-origin: center; }
.js .ss-tile { transform: scale(.6); opacity: 0; }
.js .ss-arc, .js .ss-cut { stroke-dashoffset: 1; }
.ss-logo.go .ss-tile { animation: icon-pop .6s cubic-bezier(.34, 1.56, .64, 1) .15s forwards; }
.ss-logo.go .ss-arc { animation: draw .9s cubic-bezier(.4, 0, .2, 1) .6s forwards; }
.ss-logo.go .ss-arc--b { animation-delay: .75s; }
.ss-logo.go .ss-cut { animation: draw .55s cubic-bezier(.6, 0, .2, 1) 1.55s forwards; }
/* Meshlin mark: tile, then the facets one by one, then the smooth half sweeps in */
.ml-logo { flex: none; width: clamp(120px, 38%, 210px); height: auto; overflow: visible; }
.ml-tile, .ml-facet { transform-box: fill-box; transform-origin: center; }
.js .ml-tile { transform: scale(.6); opacity: 0; }
.js .ml-facet { transform: scale(0); opacity: 0; }
.js .ml-smooth { clip-path: inset(0 100% 0 0); }
.ml-logo.go .ml-tile { animation: icon-pop .6s cubic-bezier(.34, 1.56, .64, 1) .15s forwards; }
.ml-logo.go .ml-facet { animation: icon-pop .45s cubic-bezier(.34, 1.56, .64, 1) calc(.5s + var(--i, 0) * 70ms) forwards; }
/* the order of the facets, here instead of in style attributes so the CSP can forbid inline styles */
.ml-facet:nth-child(2) { --i: 1; } .ml-facet:nth-child(3) { --i: 2; } .ml-facet:nth-child(4) { --i: 3; } .ml-facet:nth-child(5) { --i: 4; } .ml-facet:nth-child(6) { --i: 5; } .ml-facet:nth-child(7) { --i: 6; } .ml-facet:nth-child(8) { --i: 7; }
.ml-facet:nth-child(9) { --i: 8; } .ml-facet:nth-child(10) { --i: 9; } .ml-facet:nth-child(11) { --i: 10; } .ml-facet:nth-child(12) { --i: 11; } .ml-facet:nth-child(13) { --i: 12; } .ml-facet:nth-child(14) { --i: 13; }
.ml-logo.go .ml-smooth { animation: ml-sweep .8s cubic-bezier(.4, 0, .2, 1) 1.55s forwards; }
@keyframes ml-sweep { to { clip-path: inset(0 0 0 0); } }
/* Meshlin: four app screenshots, one after another */
.slides-wrap { flex: none; width: clamp(150px, 46%, 260px); }
.slides { position: relative; width: 100%; aspect-ratio: 1200 / 858; overflow: hidden; border-radius: 8px; }
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: slide 16s infinite; }
.slides img:nth-child(1) { opacity: 1; }
.slides img:nth-child(2) { animation-delay: 4s; }
.slides img:nth-child(3) { animation-delay: 8s; }
.slides img:nth-child(4) { animation-delay: 12s; }
@keyframes slide { 0% { opacity: 0; } 4%, 25% { opacity: 1; } 29%, 100% { opacity: 0; } }
.float img { animation: bob 8s ease-in-out infinite; }
.float-late img { animation-delay: -3s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* ---------- Apps: links as home-screen icons ---------- */
.apps { max-width: var(--wrap); margin: 0 auto; padding: 2vh var(--gutter) 14vh; }
.app-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(28px, 5vw, 72px); }
.app-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 170px; text-align: center; }
.app-grid .app-icon { margin-bottom: 8px; }
.app-icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 12px; transition: transform 300ms var(--ease); }
.app-icon svg { width: 60%; height: 60%; }
.app-grid a:hover .app-icon { transform: translateY(-6px); }
.app-grid a:active .app-icon { transform: scale(.94); transition-duration: 120ms; }
.app-label { font-size: 15px; color: var(--text); letter-spacing: -.01em; }
.app-thingiverse { background: #248BFB; }
.app-instagram { background: #E1306C; }
.app-researchgate { background: #00CCBB; }
.app-coffee { background: #FFDD00; color: #1a1200; }
.app-coffee .cup { width: 66%; height: 66%; stroke-width: 3.4; }
.app-grid a:hover .app-coffee .cup .steam path { animation-duration: 1.4s; }

/* staggered reveal of the icons */
.js .app-grid.reveal li { opacity: 0; transform: translateY(24px) scale(.9); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .app-grid.reveal.in li { opacity: 1; transform: none; }
.js .app-grid.reveal.in li:nth-child(2) { transition-delay: 80ms; }
.js .app-grid.reveal.in li:nth-child(3) { transition-delay: 160ms; }
.js .app-grid.reveal.in li:nth-child(4) { transition-delay: 240ms; }

/* ---------- Footer ---------- */
.footer-row { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gutter); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 15px; color: var(--text-3); }
.footer-brand { font-family: var(--display); color: var(--text); }
.footer-legal a { transition: color var(--dur); }
.footer-legal a:hover { color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .app-grid.reveal { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-bottom: 12vh; }
  .hero-figure { width: min(72vw, 420px); justify-self: center; margin-bottom: calc(24px - 12vh); }
  .work-grid { grid-template-columns: 1fr; }
  .card-media { height: auto; min-height: 0; }
  .card-edu { display: flex; }
  .card-edu .card-media { margin-bottom: 32px; }
  .card-edu .card-title { padding-top: 0; align-self: auto; }
  .card-edu .btn { align-self: flex-start; }
  .float { width: min(70vw, 360px); margin: 16px 0; }
}
@media (max-width: 720px) {
  :root { --header-h: 62px; --radius: 22px; }
  .eylo-cta { padding: 15px 20px; font-size: 12px; letter-spacing: .08em; }
  .hero-title { font-size: clamp(54px, 15.5vw, 96px); }
  .hero-sub { font-size: 19px; }
  .app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 12px; }
  .app-grid a { width: 100%; gap: 4px; }
  .app-icon { width: 68px; height: 68px; border-radius: 10px; }
  .app-label { font-size: 14px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro, .figure-video { display: none !important; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
  .cup .steam path { opacity: .7; }
  .hero .line > span, .hero-figure, .site-header { transform: none !important; opacity: 1 !important; }
  .js .reveal, .js .app-grid.reveal li { opacity: 1; transform: none; }
  .figure-still { visibility: visible !important; }
  .eylo-mark .mark-ring { stroke-dashoffset: 0 !important; }
  .eylo-mark .mark-dot { transform: none !important; opacity: 1 !important; }
  .pb-icon, .ss-tile, .ml-tile, .ml-facet { transform: none !important; opacity: 1 !important; }
  .ml-smooth { clip-path: none !important; }
  .ss-arc, .ss-cut { stroke-dashoffset: 0 !important; }
}

/* ---------- Project pages (scanbow.html, prosthobro.html) ----------
   Same palette and type as the one-pager. Title, one lead sentence, then
   the thing itself: steps, files, video, screenshots, links. */
.sub { max-width: 1120px; margin: 0 auto; padding: calc(var(--header-h) + 6vh) var(--gutter) 12vh; }
.sub-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 40px; color: var(--text-3); font-size: 15px; transition: color var(--dur); }
.sub-back:hover { color: var(--accent); }
.sub-title { font-size: clamp(56px, 4vw + 4vh + 1rem, 128px); letter-spacing: -.04em; line-height: .94; }
.sub-title i { font-style: normal; color: transparent; position: relative; }
.sub-title i::after { content: ""; position: absolute; left: .08em; bottom: .14em; width: .17em; height: .17em; background: var(--accent); }
.sub-lead { margin-top: 28px; max-width: 34ch; font-size: var(--fs-lead); line-height: 1.35; letter-spacing: -.01em; color: var(--text-2); }
.sub-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.sub-block { margin-top: clamp(72px, 12vh, 140px); }
.sub-h { font-size: clamp(32px, 1.4rem + 1.8vw, 52px); margin-bottom: 32px; }
.sub-text { color: var(--text-2); max-width: 60ch; }
.sub-text + .sub-text { margin-top: 12px; }
.sub-note { margin-top: 32px; font-size: 15px; color: var(--text-3); max-width: 70ch; }
.sub-note a { border-bottom: 1px solid var(--line-2); }

/* big media with breathing room, same 32px corners as the cards */
.sub-hero-media { margin-top: clamp(48px, 8vh, 96px); border-radius: var(--radius); background: var(--bg-card); padding: clamp(28px, 6vw, 80px); display: grid; place-items: center; }
.sub-hero-media img { width: min(100%, 760px); }

/* steps: four flat tiles, the number in champagne */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { border-radius: var(--radius); background: var(--bg-card); padding: clamp(24px, 3vw, 40px); counter-increment: step; }
.step::before { content: counter(step); display: block; font-family: var(--display); font-size: clamp(44px, 4vw, 64px); font-weight: 500; line-height: 1; color: var(--accent); margin-bottom: 20px; }
.step h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 500; font-size: clamp(22px, 1rem + .8vw, 28px); letter-spacing: -.02em; }
.step p { color: var(--text-2); }
/* steps with a drawing on top (ScanBow): the art bleeds to the tile edge, the number sits below it */
.steps--drawn .step { display: flex; flex-direction: column; }
.steps--drawn .step-art { order: -1; width: calc(100% + 2 * clamp(24px, 3vw, 40px)); max-width: none; height: auto; margin: calc(-1 * clamp(24px, 3vw, 40px)) calc(-1 * clamp(24px, 3vw, 40px)) 24px; border-radius: var(--radius) var(--radius) 0 0; }

/* files: renders on pearl tiles (they come with a white background) */
.files { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.file { display: flex; flex-direction: column; }
.file-media { border-radius: var(--radius); background: #FCFBFB; padding: clamp(20px, 3vw, 40px); aspect-ratio: 4 / 3; display: grid; place-items: center; margin-bottom: 20px; }
.file-media img { width: 100%; height: 100%; object-fit: contain; }
.file h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.02em; }
.file p { color: var(--text-2); }
.sub code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; color: var(--text); }

/* video: hard edges inside the rounded frame, controls from the browser */
.sub-video { margin-top: clamp(48px, 8vh, 96px); border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.sub-video video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* screenshots: two per row, caption below */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 24px; }
.shot img { width: 100%; border-radius: 16px; background: #141821; }
.shot figcaption { margin-top: 14px; color: var(--text-2); }
.shots, .shot { margin: 0; }

.features { display: grid; gap: 14px; max-width: 62ch; }
.features li { position: relative; padding-left: 28px; color: var(--text-2); }
.features li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 10px; background: var(--accent); }

@media (max-width: 720px) {
  .steps, .files, .shots { grid-template-columns: 1fr; }
  .sub-title { font-size: clamp(52px, 15vw, 96px); }
  .sub-lead { font-size: 19px; }
}

/* Meshlin help (/meshlin/help): chat first, then contents and compact sections */
.sub button.btn, .help-ask { border: 0; font-family: inherit; line-height: inherit; cursor: pointer; }
.help-chat { margin-top: 48px; padding: clamp(22px, 3vw, 32px); border-radius: var(--radius); background: var(--bg-card); max-width: 70ch; }
.help-chat p { color: var(--text-2); }
.help-chat .help-chat-title { color: var(--text); font-family: var(--display); font-size: clamp(22px, 1rem + .8vw, 28px); letter-spacing: -.02em; margin-bottom: 8px; }
.help-asks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.help-ask { padding: 10px 16px; border-radius: 999px; background: transparent; color: var(--text); font-size: 15px; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: color var(--dur), box-shadow var(--dur), background var(--dur); }
.help-ask:hover, .help-ask:focus-visible { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.help-ask-open { background: var(--text); color: var(--bg); box-shadow: none; }
.help-ask-open:hover, .help-ask-open:focus-visible { background: var(--accent); color: var(--bg); box-shadow: none; }
.help-toc { margin-top: 56px; }
.help-toc ol { columns: 2 220px; column-gap: 40px; margin: 0; padding-left: 1.4em; color: var(--text-3); }
.help-toc li { padding: 4px 0; break-inside: avoid; }
.help-toc a { color: var(--text-2); border-bottom: 1px solid var(--line); transition: color var(--dur); }
.help-toc a:hover { color: var(--accent); }
.help-sec { margin-top: clamp(64px, 10vh, 112px); }
.help-sec p { color: var(--text-2); max-width: 68ch; }
.help-sec p + p, .help-sec .features + p { margin-top: 14px; }
.help-sec p a { color: var(--text); border-bottom: 1px solid var(--line-2); }
.help-sec p a:hover { color: var(--accent); }
.help-h3 { margin: 36px 0 10px; font-family: var(--display); font-size: clamp(20px, 1rem + .4vw, 24px); font-weight: 500; letter-spacing: -.02em; color: var(--text); text-align: left; }
.help-sec .features { margin: 12px 0 0; padding: 0; list-style: none; }
.help-keys { width: 100%; max-width: 760px; border-collapse: collapse; margin-top: 8px; }
.help-keys th, .help-keys td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 400; }
.help-keys th { width: 40%; padding-right: 20px; white-space: nowrap; }
.help-keys td { color: var(--text-2); }
.sub kbd { display: inline-block; min-width: 1.6em; padding: 1px 7px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--sans); font-size: .9em; text-align: center; color: var(--text); }
@media (max-width: 560px) { .help-keys th { width: auto; white-space: normal; } }

/* ---------- Impressum ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: calc(var(--header-h) + 8vh) var(--gutter) 12vh; }
.legal h1 { font-size: clamp(32px, 1.4rem + 1.8vw, 52px); margin-bottom: 32px; }
.legal h2 { font-size: 22px; margin: 40px 0 12px; letter-spacing: -.02em; }
.legal p { color: var(--text-2); margin-bottom: 12px; }
.legal a { border-bottom: 1px solid var(--line-2); }
.legal .en { border-left: 2px solid var(--line-2); padding-left: 18px; font-size: 15px; margin-bottom: 40px; }
.legal .back { display: inline-block; margin-bottom: 40px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }

/* ---------- 404 ---------- */
.nf { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.nf h1 { font-size: clamp(80px, 22vw, 260px); letter-spacing: -.06em; line-height: .9; }
.nf h1 em { color: var(--accent); }
.nf p { color: var(--text-2); margin: 24px 0 36px; }
