/* rechlins.net
   ------------------------------------------------------------------
   One page, black, white type, one accent: the blue of the scrubs in
   the avatar. Five blocks: hero, EY-LO, two works side by side, four
   links as home-screen icons, footer. Few words, big type, no labels.

   TYPE: Space Grotesk for the big words, Inter for reading, Libre
   Bodoni italic for the one accent line. Self-hosted (SIL OFL), no
   external requests anywhere.

   MOTION: lines rise once, sections fade in, 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: "Space Grotesk"; src: url("assets/fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; 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: #000;
  --text: #fff;
  --text-2: rgba(255, 255, 255, .62);
  --text-3: rgba(255, 255, 255, .38);
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .22);
  --accent: #4a72c4;        /* scrub blue, lifted a little so it reads on black */
  --accent-deep: #305080;   /* the sampled scrub blue itself */
  --accent-glow: rgba(74, 114, 196, .28);

  --display: "Space Grotesk", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Inter", -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: 22px;
  --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-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: -.035em; line-height: .98; 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: #fff; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; background: #fff; color: #000; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Backdrop (static) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; left: 50%; top: 40%; width: 80vmax; height: 80vmax; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255,255,255,.07), rgba(255,255,255,.02) 45%, transparent 70%); }
.grid { position: absolute; inset: -1px;
  background-image: linear-gradient(to right, rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 0%, rgba(0,0,0,.35) 45%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 0%, rgba(0,0,0,.35) 45%, transparent 80%); }
.grain { position: absolute; inset: -100%; width: 300%; height: 300%; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 300px 300px; animation: grain 1.4s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(4%, -8%); } 60% { transform: translate(-8%, -3%); } 80% { transform: translate(6%, 7%); } 100% { transform: translate(0, 0); } }

/* ---------- Intro ---------- */
.intro { position: fixed; inset: 0; z-index: 200; background: #000; 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; 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; left: 0; right: 0; top: 0; z-index: 60; height: var(--header-h); display: flex; align-items: center; transition: background 400ms, opacity 900ms var(--ease); }
.site-header.is-scrolled { background: rgba(0,0,0,.55); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.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: 50%; 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; }
.header-cta { display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px 9px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 15px; font-weight: 500; transition: border-color var(--dur), background var(--dur); white-space: nowrap; }
.header-cta:hover { border-color: #fff; background: rgba(255,255,255,.06); }

/* ---------- 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-small { width: 26px; height: 26px; }
.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); }
}
.header-cta:hover .cup { animation: wiggle 700ms var(--ease); }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg); } 60% { transform: rotate(7deg); } }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 16px 26px; border-radius: 999px; font-weight: 500; font-size: 16px; letter-spacing: -.01em; overflow: hidden; isolation: isolate; transition: color 350ms var(--ease), transform 500ms var(--ease); }
.btn span, .btn svg { position: relative; z-index: 1; }
.btn svg { transition: transform 400ms var(--ease); }
.btn-primary { background: #fff; color: #000; }
.btn-primary::before { content: ""; position: absolute; inset: 0; background: var(--accent); border-radius: inherit; transform: translateY(101%); transition: transform 500ms var(--ease); z-index: 0; }
.btn-primary:hover { color: #fff; }
.btn-primary:hover::before { transform: translateY(0); }
.btn-primary:hover svg { transform: translate(2px, -2px); }

main { position: relative; z-index: 1; }

/* ---------- 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); letter-spacing: -.05em; line-height: .92; }
.hero-title i { font-style: normal; color: var(--accent); }
.word-accent { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; padding-right: .06em; }
.hero-sub { margin-top: 40px; max-width: 34ch; font-size: var(--fs-lead); color: var(--text-2); line-height: 1.35; letter-spacing: -.01em; }
.hero-figure { position: relative; aspect-ratio: 1; width: min(100%, 560px); justify-self: end; }
.figure-halo { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-glow), rgba(74,114,196,.06) 55%, transparent 72%); }
.figure-img { position: absolute; left: 50%; bottom: 3%; width: 88%; transform: translateX(-50%); filter: drop-shadow(0 30px 60px rgba(0,0,0,.8)); animation: bob 7s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* ---------- EY-LO ---------- */
.eylo { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) 8vh; }
.eylo-panel { position: relative; display: block; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); padding: clamp(48px, 8vw, 120px) clamp(28px, 6vw, 96px); text-align: center; isolation: isolate; transition: border-color 400ms; }
.eylo-panel:hover { border-color: var(--line-2); }
.eylo-bg { position: absolute; inset: -40%; z-index: -1; background:
  radial-gradient(40% 40% at 30% 30%, var(--accent-glow), transparent 70%),
  radial-gradient(35% 35% at 70% 70%, rgba(255,255,255,.10), transparent 70%), #050506;
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { from { transform: rotate(0deg) scale(1); } to { transform: rotate(25deg) scale(1.15); } }
.eylo-content { display: flex; flex-direction: column; align-items: center; }
.eylo-logo { width: min(60%, 420px); margin-bottom: 40px; transition: transform 800ms var(--ease); }
.eylo-panel:hover .eylo-logo { transform: scale(1.04); }
.eylo-claim { font-family: var(--display); font-size: clamp(28px, 1.5rem + 2.2vw, 58px); letter-spacing: -.035em; line-height: 1.08; }
.eylo-claim em { color: var(--accent); }
.eylo-cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 44px; padding: 16px 26px; border-radius: 999px; background: #fff; color: #000; font-weight: 500; font-size: 16px; transition: gap 300ms var(--ease), background 300ms, color 300ms; }
.eylo-panel:hover .eylo-cta { gap: 16px; background: var(--accent); color: #fff; }

/* ---------- Work: two cards 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); border: 1px solid var(--line);
  background: linear-gradient(160deg, #101013, #050506 60%); padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; transition: border-color 400ms; }
.card:hover { border-color: var(--line-2); }
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 100% 0%, rgba(255,255,255,.07), transparent 60%); pointer-events: none; }
.card-media { position: relative; display: grid; place-items: center; height: clamp(260px, 26vw, 380px); 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; }
.float { position: relative; width: min(100%, 330px); }
.float img { position: relative; z-index: 1; filter: drop-shadow(0 40px 60px rgba(0,0,0,.85)); animation: bob 8s ease-in-out infinite; }
.float-late img { animation-delay: -3s; }
.float-shadow { position: absolute; left: 15%; right: 15%; bottom: -6%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.9), transparent); filter: blur(10px); }
.heat { position: absolute; left: 50%; bottom: 6px; width: 46%; height: 5px; border-radius: 3px; transform: translateX(-50%); opacity: .8;
  background: linear-gradient(90deg, #0f3cff, #00beff 25%, #46c846 50%, #ffdc00 75%, #ff2828); }

/* ---------- 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: 14px; width: 120px; text-align: center; }
.app-icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 24px; box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25); transition: transform 500ms var(--ease), box-shadow 500ms var(--ease); }
.app-icon svg { width: 60%; height: 60%; }
.app-grid a:hover .app-icon { transform: translateY(-8px) scale(1.06); box-shadow: 0 28px 50px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.3); }
.app-grid a:active .app-icon { transform: scale(.94); transition-duration: 120ms; }
.app-label { font-size: 14px; color: var(--text-2); letter-spacing: -.01em; }
.app-thingiverse { background: linear-gradient(160deg, #3d9bff, #1b6fe0); }
.app-instagram { background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 50%, #6228d7 100%); }
.app-researchgate { background: linear-gradient(160deg, #22d9c8, #00a99a); }
.app-coffee { background: linear-gradient(160deg, #ffe066, #f5c400); color: #2b1d00; }
.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 ---------- */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--bg); }
.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: #fff; }
.footer-legal a { border-bottom: 1px solid var(--line-2); transition: border-color var(--dur), color var(--dur); }
.footer-legal a:hover { color: #fff; border-color: #fff; }

/* ---------- 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; order: -1; margin-top: 3vh; }
  .work-grid { grid-template-columns: 1fr; }
  .card-media { height: auto; min-height: 0; }
  .float { width: min(70vw, 360px); margin: 16px 0; }
}
@media (max-width: 720px) {
  :root { --header-h: 62px; --radius: 18px; }
  .header-cta .cta-label { display: none; }
  .header-cta { padding: 8px; }
  .hero-title { font-size: clamp(54px, 15.5vw, 96px); }
  .hero-sub { font-size: 19px; }
  .app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .app-grid a { width: 100%; gap: 10px; }
  .app-icon { width: 64px; height: 64px; border-radius: 17px; }
  .app-label { font-size: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro, .grain { 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; }
}
