/* ==========================================================================
   s.crpt — portfolio
   Light by default, dark via the navbar switch (html[data-theme="dark"]).
   Glass nav: liquidGL. Hero word: particlesGL.
   ========================================================================== */

/* Self-hosted fonts (Inter + Caveat, SIL Open Font License) — latin + latin-ext for Polish */

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

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

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

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

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --hand: "Caveat", cursive;

  --bg: #fafafa;
  --fg: #171717;
  --muted: #656565;
  --soft: #686868;
  --border: #e5e5e5;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #11151c;
  --fg: #f1f2f5;
  --muted: #b6bdc7;
  --soft: #c1c7d0;
  --border: #ffffff2b;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: #bdbdbd var(--bg);
}

html[data-theme="dark"] {
  scrollbar-color: #3b434e var(--bg);
}

/* Lenis */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  font-synthesis: none;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body,
.hero,
.phone-services,
.projects-intro,
.about-section,
.footer,
.stack-code-card,
.code-window,
.project-logo-card,
.phone-stage {
  transition: background 0.8s ease, color 0.8s ease, border-color 0.8s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

p {
  color: var(--muted);
  line-height: 1.8;
}

::selection {
  background: #222;
  color: #fff;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #555;
  outline-offset: 5px;
}

html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible {
  outline-color: #c1c7d0;
}

.i {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 20px;
  top: -100px;
  z-index: 100002;
  background: #171717;
  color: #fff;
  padding: 16px;
}

.skip-link:focus {
  top: 10px;
}

.container {
  width: calc(100% - 156px);
  max-width: 1180px;
  margin: 0 auto;
}

.muted {
  color: #858585;
}

/* ==========================================================================
   Preloader + page transition
   ========================================================================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  background: var(--bg);
  transition: opacity 0.9s var(--ease), visibility 0s linear 0.9s;
}

.preloader__inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--soft);
}

.preloader__mark {
  color: var(--fg);
}

.preloader__bar {
  height: 1px;
  background: var(--border);
  overflow: hidden;
}

.preloader__bar span {
  display: block;
  height: 100%;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.4s var(--ease);
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
}

html.page-arriving .preloader {
  display: none;
}

/* Page transition: the page dissolves into a strong blur on the way out,
   and the next page sharpens out of the same blur on the way in */
:root {
  --pt-blur: 34px;
  --pt-tint: #fafafa8c;
}

html[data-theme="dark"] {
  --pt-tint: #11151c8c;
}

.page-transition,
html.page-arriving::after {
  position: fixed;
  inset: 0;
  z-index: 100003;
  pointer-events: none;
}

html.page-arriving::after,
.page-transition {
  content: "";
  background: var(--pt-tint);
  -webkit-backdrop-filter: blur(var(--pt-blur)) saturate(1.15);
  backdrop-filter: blur(var(--pt-blur)) saturate(1.15);
}

/* Blocks clicks while the page is leaving */
.page-transition.pt-leave {
  pointer-events: all;
  animation: pt-blur-in 0.6s cubic-bezier(0.5, 0, 0.2, 1) both;
}

.page-transition.pt-enter {
  animation: pt-blur-out 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pt-blur-in {
  from {
    background: transparent;
    -webkit-backdrop-filter: blur(0) saturate(1);
    backdrop-filter: blur(0) saturate(1);
  }
}

@keyframes pt-blur-out {
  to {
    background: transparent;
    -webkit-backdrop-filter: blur(0) saturate(1);
    backdrop-filter: blur(0) saturate(1);
  }
}

/* ==========================================================================
   Cursor (fine pointers only)
   ========================================================================== */

.cursor {
  display: none;
}

.has-cursor .cursor {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100001;
  pointer-events: none;
  mix-blend-mode: difference;
  transition: opacity 0.3s;
}

.has-cursor,
.has-cursor a,
.has-cursor button {
  cursor: none;
}

/* The contact panel lives in the top layer, above the custom cursor */
.has-cursor.contact-open,
.has-cursor.contact-open a,
.has-cursor.contact-open button {
  cursor: auto;
}
.has-cursor.contact-open a,
.has-cursor.contact-open button {
  cursor: pointer;
}
.contact-open .cursor {
  opacity: 0;
}

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  translate: -50% -50%;
}

.cursor__dot {
  width: 6px;
  height: 6px;
  background: #fff;
  transition: scale 0.3s var(--ease);
}

.cursor__ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: width 0.45s var(--ease), height 0.45s var(--ease), border-color 0.3s;
}

.cursor.is-link .cursor__ring {
  width: 56px;
  height: 56px;
  border-color: #fff;
}

.cursor.is-link .cursor__dot {
  scale: 0;
}

.cursor.is-focus .cursor__ring {
  width: 150px;
  height: 150px;
  border-color: rgba(255, 255, 255, 0.35);
  border-style: dashed;
}

.cursor.is-hidden {
  opacity: 0;
}

/* ==========================================================================
   Nav — liquidGL target (.nav-glass)
   ========================================================================== */

.nav-anchor {
  position: fixed;
  top: 22px;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav-glass {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: calc(100% - 112px);
  max-width: 1328px;
  height: 68px;
  padding: 0 14px 0 22px;
  border-radius: 20px;
  border: 1px solid #ffffff9c;
  color: #171717;
  /* Fallback look if WebGL/WebGPU is unavailable (liquidGL clears these) */
  background: #ffffffc4;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

html[data-theme="dark"] .nav-glass {
  border-color: #ffffff70;
  color: #f0f2f5;
  background: #202733d9;
}

/* Tint + top highlight so the pane reads as glass; the refraction shows through */
.nav-glass__sheen,
.nav-glass__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.nav-glass__sheen {
  z-index: 1;
  overflow: hidden;
  background: linear-gradient(105deg, #ffffff5c, #ffffff1f 50%, #f4f4f447);
  /* bright liquid rim: top highlight, inner edge glow, soft lower bounce */
  box-shadow: inset 0 1px 1px #fffffff2, inset 0 0 0 1px #ffffff59, inset 0 12px 18px -14px #ffffffd9,
    inset 0 -10px 16px -14px #ffffffa6, inset 0 -1px 1px #7773;
  transition: background 0.8s ease;
}

html[data-theme="dark"] .nav-glass__sheen {
  background: linear-gradient(110deg, #343c4985, #1e242d8c);
  box-shadow: inset 0 1px 1px #ffffff66, inset 0 0 0 1px #ffffff1f, inset 0 12px 18px -14px #ffffff4d,
    inset 0 -10px 16px -14px #ffffff26, inset 0 -1px 1px #0006;
}

/* A slow band of light that slides across the glass now and then */
.nav-glass__sheen::after {
  content: "";
  position: absolute;
  inset: -60% -20%;
  background: linear-gradient(105deg, transparent 40%, #ffffff8f 47%, #ffffff2e 52%, transparent 58%);
  transform: translateX(-75%);
  animation: glass-sweep 9s cubic-bezier(0.45, 0, 0.2, 1) 1.5s infinite;
}

html[data-theme="dark"] .nav-glass__sheen::after {
  background: linear-gradient(105deg, transparent 40%, #ffffff2e 47%, #ffffff0d 52%, transparent 58%);
}

@keyframes glass-sweep {
  0%,
  62% {
    transform: translateX(-75%);
  }
  88%,
  100% {
    transform: translateX(75%);
  }
}

/* Soft light that follows the pointer while it is over the bar */
.nav-glass__glow {
  z-index: 2;
  background: radial-gradient(
    ellipse 170px 90px at var(--pointer-x, 50%) var(--pointer-y, 50%),
    #5555 0%,
    #7772 35%,
    #8880 75%
  );
  opacity: 0;
  transition: opacity 0.4s;
}

html[data-theme="dark"] .nav-glass__glow {
  background: radial-gradient(
    ellipse 170px 90px at var(--pointer-x, 50%) var(--pointer-y, 50%),
    #fff3 0%,
    #fff1 35%,
    #fff0 75%
  );
}

.nav-glass[data-hover="true"] .nav-glass__glow {
  opacity: 1;
}

/* Content sits above the lens; liquidGL sets pointer-events:none on the target */
.wordmark,
.nav-links,
.nav-actions,
.mobile-menu {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.wordmark {
  font-weight: 780;
  font-size: 26px;
  letter-spacing: -1.5px;
  line-height: 1;
}

.nav-links {
  position: relative;
}

.nav-links ul {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 14px;
  color: #646464;
  transition: color 0.25s, background 0.25s;
}

.nav-links a:hover {
  background: #6868680e;
  color: #171717;
}

.nav-links a[aria-current="page"] {
  color: #161616;
}

html[data-theme="dark"] .nav-links a {
  color: #c3c9d2;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a[aria-current="page"] {
  color: #fff;
}

/* Sliding "current section" pill */
.nav-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  height: 40px;
  width: var(--w, 0px);
  translate: var(--x, 0px) -50%;
  border-radius: 10px;
  background: #73737312;
  box-shadow: inset 0 1px 2px #00000006;
  opacity: 0;
  transition: translate 0.55s var(--ease), width 0.55s var(--ease), opacity 0.3s;
}

.nav-indicator.is-visible {
  opacity: 1;
}

html[data-theme="dark"] .nav-indicator {
  background: #ffffff20;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-contact {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 11px 15px;
  border: 1px solid #ffffffa8;
  border-radius: 12px;
  background: #ffffff55;
  box-shadow: inset 0 1px 0 #fff8;
  font-size: 13px;
  transition: background 0.3s, transform 0.3s var(--ease);
}

.nav-contact:hover {
  background: #ffffff9a;
}

html[data-theme="dark"] .nav-contact {
  background: #ffffff18;
  color: #f5f6f8;
  border-color: #ffffff55;
  box-shadow: none;
}

html[data-theme="dark"] .nav-contact:hover {
  background: #ffffff28;
}

/* Sun / moon switch */
.theme-switch {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #8885;
  border-radius: 50%;
  background: #ffffff45;
  color: #50545b;
  transition: background 0.65s, border-color 0.65s, color 0.65s, transform 0.4s;
}

.theme-switch:hover {
  transform: rotate(12deg);
}

html[data-theme="dark"] .theme-switch {
  background: #ffffff18;
  color: #f5f6f8;
  border-color: #ffffff55;
}

.theme-orb {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  transform: scale(0.78);
}

.theme-disc {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.75s cubic-bezier(0.2, 1, 0.3, 1), background 0.65s;
}

.theme-cutout {
  position: absolute;
  top: 4px;
  left: 15px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fafafa;
  transform: translate(23px, -18px);
  transition: transform 0.75s cubic-bezier(0.2, 1, 0.3, 1), background 0.65s;
}

.theme-orb i {
  position: absolute;
  left: 15px;
  top: 1px;
  width: 2px;
  height: 5px;
  border-radius: 4px;
  background: currentColor;
  transform-origin: 1px 15px;
  transform: rotate(calc(var(--ray) * 45deg)) scaleY(1);
  transition: transform 0.65s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.5s;
}

html[data-theme="dark"] .theme-cutout {
  transform: translate(0, 0);
  background: #202733;
}

html[data-theme="dark"] .theme-orb i {
  transform: rotate(calc(var(--ray) * 45deg)) scaleY(0);
  opacity: 0;
}

html[data-theme="dark"] .theme-disc {
  transform: rotate(-35deg);
}

.menu-toggle {
  display: none;
  padding: 8px;
  border: 0;
  background: none;
}

.menu-toggle .i-close,
.menu-toggle[aria-expanded="true"] .i-menu {
  display: none;
}

.menu-toggle[aria-expanded="true"] .i-close {
  display: block;
}

.mobile-menu {
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  padding: 12px 22px;
  border: 1px solid #fff;
  border-radius: 16px;
  background: #f0f0f0f2;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 40px #0000000a;
}

.mobile-menu[hidden] {
  display: none;
}

html[data-theme="dark"] .mobile-menu {
  color: #f0f2f5;
  background: #252a33f2;
  border-color: #ffffff45;
}

.mobile-menu a,
.mobile-menu button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid #0000000f;
  background: none;
  font-size: 15px;
  text-align: left;
}

html[data-theme="dark"] .mobile-menu a {
  border-color: #ffffff1a;
}

.mobile-menu button {
  border-bottom: 0;
}

/* ==========================================================================
   Hero — main screen
   ========================================================================== */

.hero {
  position: relative;
  min-height: 780px;
  height: 100svh;
  max-height: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #fff 0%, #fafafa80 65%, #f5f5f5 100%);
}

html[data-theme="dark"] .hero {
  color: #f2f3f5;
  background: radial-gradient(ellipse at 50% 42%, #292e39, #11151c 70%, #090c12);
}

.liquid-background,
.hero-ambient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.liquid-background svg {
  width: 100%;
  height: 100%;
}

.liquid-form {
  transform-origin: center;
  animation: liquid-drift 22s ease-in-out infinite alternate;
}

html[data-theme="dark"] .liquid-background {
  opacity: 0.12;
  mix-blend-mode: screen;
}

@keyframes liquid-drift {
  from {
    transform: translate(-12px, 14px) rotate(-3deg);
  }
  to {
    transform: translate(12px, -10px) rotate(3deg);
  }
}

.hero-ambient {
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  margin-top: 20px;
  text-align: center;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #626262;
  box-shadow: 0 0 0 3px #e8e8e8;
}

html[data-theme="dark"] .status-dot {
  background: #c1c7d0;
  box-shadow: 0 0 0 3px #ffffff1c;
}

/* ---- The particle word (replaces check-this's solid typed title) ---- */

.hero-title {
  --title-size: clamp(110px, min(15.4vw, 25svh), 230px);
  margin-top: 16px;
  line-height: 1;
  font-weight: 730;
}

.hero__word {
  position: relative;
  display: block;
  /* particlesGL maps the source canvas to this box; its aspect is fixed by JS */
  width: min(
    calc(100vw - 56px),
    calc(var(--title-size) * var(--word-em, 1.2) * var(--word-aspect, 2.6))
  );
  aspect-ratio: var(--word-aspect, 2.6);
  margin: 0 auto;
}

.hero__mirror,
.hero__source {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Hidden on screen; liquidGL's rasteriser ignores clip-path so the glass still sees it */
.hero__mirror {
  clip-path: inset(50%);
  pointer-events: none;
}

.hero__particles {
  position: absolute;
  inset: 0;
  display: block;
}

/* Letters appear one by one: a soft mask sweeps right as each letter is "typed" */
.hero__word.is-typing .hero__particles {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--reveal-x, 0%) - 3%), transparent calc(var(--reveal-x, 0%) + 1%));
  mask-image: linear-gradient(90deg, #000 calc(var(--reveal-x, 0%) - 3%), transparent calc(var(--reveal-x, 0%) + 1%));
}

/* particlesGL reads pixels, not CSS opacity — keep the solid source invisible */
.hero__source {
  opacity: 0;
}

.hero__particles canvas[data-particles-target] {
  opacity: 0;
  filter: blur(10px);
  transition: opacity 1.2s var(--ease), filter 2.2s var(--ease);
}

.hero__particles.is-live canvas[data-particles-target] {
  opacity: 1;
  filter: blur(0);
}

.hero__word .letter-sparks {
  left: var(--spark-x, 100%);
  top: 50%;
}

.typing-cursor {
  display: inline-block;
  margin-left: 0.05em;
  font-weight: 260;
  font-size: 0.64em;
  letter-spacing: -0.1em;
  color: #707070;
  animation: blink 1.15s step-end infinite;
}

html[data-theme="dark"] .typing-cursor {
  color: #d2d6df;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.letter-sparks {
  position: absolute;
  left: 100%;
  top: 52%;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  pointer-events: none;
}

.letter-sparks i {
  position: absolute;
  color: #737373;
  font-style: normal;
  animation: letter-spark 0.85s var(--spark-delay) both cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .letter-sparks i {
  color: #c1c7d0;
}

@keyframes letter-spark {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2) rotate(0);
  }
  18% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) scale(0.15) rotate(100deg);
  }
}

.hero-role {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 15px;
  font-size: 17px;
  font-weight: 450;
  color: #636363;
}

.hero-role > span {
  width: 25px;
  height: 1px;
  background: #cfcfcf;
}

html[data-theme="dark"] .hero-role {
  color: var(--soft);
}

html[data-theme="dark"] .hero-role > span {
  background: #ffffff40;
}

.hero-lead {
  margin: 26px auto 0;
  font-size: 16px;
  line-height: 1.9;
}

html[data-theme="dark"] .hero-lead {
  color: var(--soft);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  min-height: 46px;
  padding: 13px 20px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s, background 0.8s, color 0.8s;
}

.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px #00000010;
}

.button-dark {
  border: 1px solid #202020;
  background: #202020;
  color: #fff;
  box-shadow: 0 3px 5px #00000015;
}

.button-light {
  border: 1px solid #dedede;
  background: #ffffffb3;
}

html[data-theme="dark"] .button-dark {
  border-color: #f0f2f5;
  background: #f0f2f5;
  color: #11151c;
}

html[data-theme="dark"] .button-light {
  border-color: #ffffff45;
  background: #ffffff18;
  color: #f0f2f5;
}

.floating-label {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  color: var(--soft);
}

.label-left {
  left: 11%;
  top: 53%;
  transform: rotate(-7deg);
}

.label-right {
  right: 9%;
  top: 68%;
  transform: rotate(7deg);
}

.hero-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soft);
}

.hero-bottom > a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}

.scroll-line {
  width: 1px;
  height: 22px;
  margin-right: 4px;
  background: linear-gradient(transparent, #aaa);
}

@media (min-width: 1700px) {
  .hero-content {
    transform: scale(1.12);
  }
}

/* ==========================================================================
   Sections — shared
   ========================================================================== */

.section {
  padding-top: 112px;
  padding-bottom: 112px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #666;
}

html[data-theme="dark"] .section-label {
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 44px;
}

.section-heading h2 {
  font-size: clamp(28px, 3.1vw, 44px);
  font-weight: 520;
  letter-spacing: -1.8px;
  line-height: 1.2;
}

.section-heading > p {
  max-width: 270px;
  padding-bottom: 3px;
  font-size: 14px;
  line-height: 1.7;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  transition: color 0.25s;
}

.text-link:hover {
  color: #111;
}

html[data-theme="dark"] .text-link:hover {
  color: #fff;
}

/* Standalone pages (Technologie, O mnie) */
.section.route-page {
  min-height: calc(100svh - 84px);
  padding-top: 180px;
  padding-bottom: 100px;
}

.about-section.about-route {
  display: flex;
  align-items: center;
  min-height: calc(100svh - 91px);
  padding-top: 70px;
  border-top: 0;
}

/* ==========================================================================
   Co robię — phone services
   ========================================================================== */

.phone-services {
  padding-top: 110px;
  padding-bottom: 110px;
}

.phone-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 54px 24px;
}

.phone-service {
  text-align: left;
  perspective: 900px;
}

.phone-stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 390px;
  overflow: hidden;
  border: 1px solid #ececec;
  border-radius: 24px;
  background: linear-gradient(155deg, #f3f3f3, #eaeaea 70%, #f5f5f5);
}

html[data-theme="dark"] .phone-stage {
  background: linear-gradient(155deg, #262b33, #191d25);
  border-color: #353b46;
}

.phone-halo {
  position: absolute;
  width: 80%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  filter: blur(35px);
  opacity: 0.85;
}

html[data-theme="dark"] .phone-halo {
  background: #78828c;
  opacity: 0.24;
}

.phone-render {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 12px #00000014);
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.55s var(--ease);
  animation: phone-drift 6s ease-in-out infinite;
}

html[data-theme="dark"] .phone-render {
  filter: drop-shadow(0 18px 16px #0000004d);
}

.phone-service-grid > :nth-child(2n) .phone-render {
  animation-delay: -2s;
}

.phone-service-grid > :nth-child(3n) .phone-render {
  animation-delay: -4s;
}

@keyframes phone-drift {
  0%,
  100% {
    translate: 0 4px;
    rotate: -0.6deg;
  }
  50% {
    translate: 0 -7px;
    rotate: 0.6deg;
  }
}

.phone-service-copy {
  padding: 26px 8px 0;
}

.phone-service-copy > .mono {
  font-size: 9px;
  color: #6b6b6b;
}

html[data-theme="dark"] .phone-service-copy > .mono {
  color: var(--muted);
}

.phone-service h3 {
  margin: 9px 0 10px;
  font-size: 24px;
  font-weight: 580;
  letter-spacing: -0.9px;
}

.phone-service p {
  max-width: 310px;
  font-size: 14px;
}

.service-link {
  margin-top: 48px;
  color: #666;
}

html[data-theme="dark"] .service-link {
  color: var(--muted);
}

/* ==========================================================================
   Projekty — intro + selection
   ========================================================================== */

.projects-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: max(740px, 100svh);
  padding: 195px 24px 100px;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(ellipse at 50% 43%, #fff, #f4f4f4);
}

html[data-theme="dark"] .projects-intro {
  background: radial-gradient(ellipse at 50% 43%, #292e39, #11151c);
}

.projects-intro > .section-label {
  margin-bottom: 22px;
}

.typing-title-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.typing-title {
  position: relative;
  white-space: nowrap;
}

.title-width-keeper {
  visibility: hidden;
}

.title-live {
  position: absolute;
  inset: 0 auto auto 0;
  min-height: 1em;
}

.typed-word {
  position: relative;
}

.projects-type h1 {
  font-size: clamp(64px, 9vw, 132px);
  font-weight: 650;
  letter-spacing: -0.075em;
  line-height: 1.25;
}

.projects-intro p {
  margin-top: 22px;
  font-size: 15px;
}

.explore-button {
  margin-top: 30px;
}

.projects-whisper {
  position: absolute;
  bottom: 40px;
  font-size: 9px;
  color: #6b6b6b;
}

html[data-theme="dark"] .projects-whisper {
  color: var(--muted);
}

.project-selection {
  padding-top: 110px;
  padding-bottom: 110px;
}

.selection-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 40px;
}

.selection-heading h2 {
  margin-top: 14px;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 560;
  letter-spacing: -1.5px;
}

.selection-heading > .mono {
  padding-bottom: 8px;
  font-size: 9px;
  color: #696969;
}

html[data-theme="dark"] .selection-heading > .mono {
  color: var(--muted);
}

.project-logo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.project-logo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 32px;
  border: 1px solid #e2e2e2;
  border-radius: 23px;
  background: #f4f4f4;
  transition: transform 0.45s, box-shadow 0.45s, background 0.45s, border-color 0.8s;
}

.project-logo-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 20px 40px #00000009;
}

.project-logo-card.coralshop:hover {
  background: #e4e3fa;
}
.project-logo-card.solarcode:hover {
  background: #f1edcb;
}
.project-logo-card.kupuj:hover {
  background: #e3e3e3;
}

html[data-theme="dark"] .project-logo-card {
  background: #202631;
  border-color: #3c444f;
}
html[data-theme="dark"] .project-logo-card.coralshop:hover {
  background: #33334e;
}
html[data-theme="dark"] .project-logo-card.solarcode:hover {
  background: #494331;
}
html[data-theme="dark"] .project-logo-card.kupuj:hover {
  background: #32363d;
}

.project-logo-card > .brand-travel {
  display: grid;
  place-items: center;
  flex: 1;
}

.project-brand {
  display: block;
  width: 105px;
  height: 105px;
  object-fit: contain;
}

/* Round animated Kupuj logo: soft lift on light cards, a hairline ring on dark ones */
.project-brand.kupuj {
  border-radius: 50%;
  box-shadow: 0 10px 24px #0000002e;
}

html[data-theme="dark"] .project-brand.kupuj {
  box-shadow: 0 0 0 1px #ffffff1f, 0 10px 24px #0000004d;
}

.project-card-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 35px;
}

.project-card-label .mono {
  font-size: 8px;
  color: #6b6b6b;
}

html[data-theme="dark"] .project-card-label .mono {
  color: var(--muted);
}

.project-card-label h3 {
  margin-top: 7px;
  font-size: 23px;
  font-weight: 570;
  letter-spacing: -0.8px;
}

.project-card-label .i {
  transition: transform 0.45s var(--ease);
}

.project-logo-card:hover .project-card-label .i {
  transform: translate(3px, -3px);
}

/* ==========================================================================
   Technologie — code cards
   ========================================================================== */

.stack-intro {
  margin-bottom: 60px;
}

.stack-intro h1 {
  margin-top: 22px;
  font-size: clamp(58px, 7vw, 100px);
  font-weight: 580;
  line-height: 1.08;
  letter-spacing: -0.065em;
}

.stack-intro h1 > span {
  color: #8d8d8d;
}

html[data-theme="dark"] .stack-intro h1 > span {
  color: #b5bbc4;
}

.stack-intro p {
  margin-top: 24px;
  font-size: 14px;
}

.stack-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.stack-code-card {
  overflow: hidden;
  border: 1px solid #e2e2e2;
  border-radius: 19px;
  background: #fff;
}

html[data-theme="dark"] .stack-code-card {
  background: #202631;
  border-color: #3b434e;
}

.stack-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 23px;
  border-bottom: 1px solid #e9e9e9;
}

.stack-card-heading .tech-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
}

.stack-card-heading h2 {
  font-size: 14px;
  font-weight: 590;
  letter-spacing: -0.3px;
}

.stack-card-heading > .mono {
  margin-left: auto;
  font-size: 9px;
  color: #727272;
}

html[data-theme="dark"] .stack-card-heading,
html[data-theme="dark"] .stack-card-bottom,
html[data-theme="dark"] .stack-card-heading .tech-mark {
  border-color: #3b434e;
}

html[data-theme="dark"] .stack-card-heading > .mono,
html[data-theme="dark"] .stack-card-bottom {
  color: var(--muted);
}

.stack-code-card pre {
  height: 242px;
  margin: 0;
  padding: 28px 24px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  color: #545454;
  white-space: pre;
  tab-size: 2;
}

html[data-theme="dark"] .stack-code-card pre {
  color: #d3d8df;
}

.code-typed {
  display: inline;
}

.code-caret {
  color: #aaa;
  animation: blink 1s step-end infinite;
}

.stack-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 23px;
  border-top: 1px solid #eee;
  font-size: 8px;
  color: #747474;
}

.stack-card-bottom > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #999;
}

/* ==========================================================================
   O mnie — about + code window
   ========================================================================== */

.about-section {
  background: #f3f3f3;
  /* top edge only: the footer's own border closes the section below */
  border-top: 1px solid #e6e6e6;
}

html[data-theme="dark"] .about-section {
  background: #151a22;
  border-color: #ffffff17;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 100px;
  align-items: center;
}

.about-asterisk {
  display: block;
  margin: 20px 0 22px;
  color: #686868;
  stroke-width: 1;
}

html[data-theme="dark"] .about-asterisk {
  color: var(--soft);
}

.about-grid h1 {
  margin-bottom: 30px;
  font-size: 54px;
  font-weight: 500;
  letter-spacing: -2.5px;
  line-height: 1.1;
}

.about-grid p {
  max-width: 430px;
  margin-bottom: 17px;
  font-size: 16px;
  line-height: 1.9;
}

.about-signoff {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 30px;
}

.about-signoff .wordmark {
  font-size: 23px;
}

.about-signoff .mono {
  font-size: 9px;
  color: #686868;
}

html[data-theme="dark"] .about-signoff .mono {
  color: var(--muted);
}

.code-window {
  overflow: hidden;
  border: 1px solid #dcdcdc;
  border-radius: 14px;
  background: #fbfbfb;
  box-shadow: 0 16px 40px #00000005;
  transform: rotate(1deg);
}

html[data-theme="dark"] .code-window {
  background: #202631;
  border-color: #3b434e;
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 47px;
  padding: 0 17px;
  border-bottom: 1px solid #e2e2e2;
  background: #f7f7f7;
  color: #686868;
}

html[data-theme="dark"] .code-title {
  background: #1b2029;
  border-color: #3b434e;
  color: var(--muted);
}

.code-title > span:first-child {
  display: flex;
  gap: 5px;
}

.code-title i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cfcfcf;
}

html[data-theme="dark"] .code-title i {
  background: #4a5260;
}

.code-title .mono {
  font-size: 10px;
}

.code-body {
  padding: 26px 0 30px;
}

.code-body pre {
  margin: 0;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
}

.code-line {
  display: flex;
  min-height: 22px;
  color: #666;
  white-space: pre;
}

html[data-theme="dark"] .code-line {
  color: #d3d8df;
}

.line-number {
  display: inline-block;
  min-width: 44px;
  padding-right: 17px;
  text-align: right;
  color: #707070;
  user-select: none;
}

html[data-theme="dark"] .line-number {
  color: #6f7887;
}

.code-string {
  color: #333;
}

html[data-theme="dark"] .code-string {
  color: #fff;
}

.code-line:last-child > span:last-child::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 13px;
  margin-left: 5px;
  vertical-align: middle;
  background: #999;
  animation: blink 1.1s step-end infinite;
}

.code-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-top: 1px solid #e5e5e5;
  font-size: 8px;
  color: #686868;
}

html[data-theme="dark"] .code-status {
  border-color: #3b434e;
  color: var(--muted);
}

.code-status > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-status .status-dot {
  width: 4px;
  height: 4px;
  box-shadow: none;
}

/* Lines wipe in one after another (clip-path only, so the glass snapshot is unaffected) */
.reveal-armed .code-window .code-line {
  clip-path: inset(0 100% 0 0);
}

.reveal-armed .code-window.is-in .code-line {
  animation: code-appear 0.5s ease both;
  animation-delay: calc(var(--d, 0s) + 0.3s + var(--n, 0) * 0.05s);
}

@keyframes code-appear {
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* ==========================================================================
   Kontakt — panel (opened from the "Porozmawiajmy" button)
   ========================================================================== */

.contact-content {
  width: 100%;
}

.contact-discord {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border: 0;
  border-radius: 17px;
  background: #252525;
  color: #fff;
  text-align: left;
  transition: transform 0.25s, background 0.25s;
}

.contact-discord:hover {
  transform: translateY(-2px);
  background: #1d1d1d;
}

html[data-theme="dark"] .contact-discord {
  background: #11151c;
  color: #f1f2f5;
  box-shadow: inset 0 0 0 1px #ffffff1f;
}

html[data-theme="dark"] .contact-discord:hover {
  background: #0c1016;
}

.contact-discord > span:not(.sr-only) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-discord small {
  font-size: 10px;
  color: #c3c3c3;
}

html[data-theme="dark"] .contact-discord small {
  color: #9aa3ae;
}

.contact-discord strong {
  font-size: 24px;
  font-weight: 540;
  letter-spacing: -0.7px;
}

.contact-discord .copy-icon,
.contact-discord .check-icon {
  margin-left: auto;
}

.contact-discord .check-icon,
.contact-discord.is-copied .copy-icon {
  display: none;
}

.contact-discord.is-copied .check-icon {
  display: block;
}

.contact-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.contact-secondary > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 18px 12px;
  border: 1px solid #fff;
  border-radius: 17px;
  background: #ffffffad;
  transition: background 0.25s, transform 0.25s;
}

.contact-secondary > a:hover {
  background: #fff;
  transform: translateY(-3px);
}

html[data-theme="dark"] .contact-secondary > a {
  background: #ffffff12;
  border-color: #ffffff27;
}

html[data-theme="dark"] .contact-secondary > a:hover {
  background: #ffffff22;
}

.contact-secondary img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
}

.contact-secondary .solarcode-card img {
  padding: 15px;
}

.contact-secondary span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 560;
}

.contact-secondary small {
  margin-top: 5px;
  font-size: 10px;
  color: #666;
}

html[data-theme="dark"] .contact-secondary small {
  color: #c5cbd3;
}

.copy-feedback {
  min-height: 18px;
  margin-top: 19px;
  font-size: 10px;
  text-align: center;
  color: #676767;
}

html[data-theme="dark"] .copy-feedback {
  color: #c5cbd3;
}

/* Native <dialog>: top layer, focus trap and Escape come for free */
.contact-panel {
  position: fixed;
  inset: 106px max(56px, calc((100vw - 1328px) / 2)) auto auto;
  width: 460px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 126px);
  margin: 0;
  padding: 30px;
  overflow-y: auto;
  border: 1px solid #fff9;
  border-radius: 29px;
  background: linear-gradient(140deg, #f5f5f5f5, #e6e6e6f5);
  box-shadow: inset 0 1px 1px #fff, 0 28px 80px #0003;
  color: #171717;
  transform-origin: var(--origin-x, calc(100% - 80px)) var(--origin-y, -35px);
}

.contact-panel[open] {
  animation: contact-expand 0.65s cubic-bezier(0.22, 1.18, 0.36, 1) both;
}

.contact-panel.is-closing {
  animation: contact-collapse 0.22s ease both;
}

.contact-panel::backdrop {
  background: #34343428;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: backdrop-in 0.4s ease both;
}

.contact-panel.is-closing::backdrop {
  animation: backdrop-out 0.22s ease both;
}

html[data-theme="dark"] .contact-panel {
  background: linear-gradient(140deg, #323943, #1c222b);
  color: #f1f2f5;
  border-color: #57616f;
  box-shadow: inset 0 1px 1px #ffffff26, 0 28px 80px #0008;
}

@keyframes contact-expand {
  from {
    opacity: 0;
    transform: scale(0.35, 0.08) translateY(-50px);
    filter: blur(8px);
    border-radius: 50px;
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

@keyframes contact-collapse {
  to {
    opacity: 0;
    transform: scale(0.6, 0.3) translateY(-40px);
    filter: blur(5px);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

@keyframes backdrop-out {
  to {
    opacity: 0;
  }
}

.contact-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.contact-panel-head h2 {
  font-size: 25px;
  font-weight: 590;
  letter-spacing: -0.9px;
  line-height: 1.3;
}

.contact-panel-head p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #636363;
}

html[data-theme="dark"] .contact-panel-head p {
  color: #c5cbd3;
}

.contact-panel .contact-content {
  margin-top: 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #00000008;
}

html[data-theme="dark"] .icon-button {
  background: #ffffff14;
}

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

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 30px 0;
  border-top: 1px solid #e0e0e0;
  font-size: 10px;
  color: #686868;
}

html[data-theme="dark"] .footer {
  border-color: var(--border);
  color: var(--muted);
}

.footer strong {
  font-weight: 600;
  color: #444;
}

html[data-theme="dark"] .footer strong {
  color: #fff;
}

.footer > a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  border-radius: 50%;
  transition: transform 0.3s var(--ease);
}

.footer > a:hover {
  transform: translateY(-3px);
}

html[data-theme="dark"] .footer > a {
  border-color: #ffffff35;
}

.footer > span:nth-child(2) {
  margin-left: auto;
  margin-right: 30px;
}

/* ==========================================================================
   Project detail page
   ========================================================================== */

.project-detail {
  position: relative;
  min-height: calc(100svh - 84px);
  overflow: hidden;
  isolation: isolate;
}

.project-detail-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -2;
  animation: atmosphere-in 1.1s ease both;
}

.project-detail.coralshop .project-detail-atmosphere {
  background: radial-gradient(ellipse at 80% 20%, #b4f4f1, transparent 60%), linear-gradient(130deg, #e1d9ff, #edf4f6);
}

.project-detail.solarcode .project-detail-atmosphere {
  background: radial-gradient(ellipse at 85% 65%, #d8e79c, transparent 55%),
    radial-gradient(ellipse at 10% 0%, #ffd580, transparent 60%), linear-gradient(120deg, #ffbd83, #fcf3bd);
}

.project-detail.kupuj .project-detail-atmosphere {
  background: radial-gradient(ellipse at 75% 20%, #858585, transparent 56%), linear-gradient(145deg, #111, #444 55%, #242424);
}

html[data-theme="dark"] .project-detail.coralshop .project-detail-atmosphere {
  background: radial-gradient(ellipse at 80% 20%, #304a50, transparent 60%), linear-gradient(130deg, #24243d, #18242b);
}

html[data-theme="dark"] .project-detail.solarcode .project-detail-atmosphere {
  background: radial-gradient(ellipse at 85% 65%, #414b2b, transparent 55%), linear-gradient(120deg, #3e3028, #29291e);
}

.project-detail {
  --detail-ink: #252525;
}

.project-detail.kupuj {
  --detail-ink: #f1f1f1;
}

html[data-theme="dark"] .project-detail {
  --detail-ink: #f1f2f5;
}

.project-detail .detail-back,
.project-detail .detail-category,
.project-detail .detail-description p,
.project-detail .detail-bottom,
.project-detail .detail-bottom .mono,
.project-detail .text-link,
.project-detail .project-brand {
  color: var(--detail-ink);
}

.project-detail:not(.kupuj) .detail-back,
.project-detail:not(.kupuj) .detail-category,
.project-detail:not(.kupuj) .detail-description p {
  opacity: 0.85;
}

@keyframes atmosphere-in {
  from {
    opacity: 0.2;
    scale: 1.05;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

/* The hidden attribute doesn't hide SVG elements, so say it explicitly */
.coral-vectors[hidden] {
  display: none;
}

.coral-vectors {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.32;
  pointer-events: none;
}

.detail-content {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 84px);
  padding-top: 154px;
  padding-bottom: 36px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: start;
  font-size: 12px;
}

.detail-brand-row {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-top: 72px;
}

.detail-brand {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
}

.handwritten {
  width: min(560px, 65%);
  font-family: var(--hand);
  line-height: 1;
}

.handwritten svg {
  width: 100%;
  overflow: visible;
}

.handwritten text {
  font-size: 132px;
  font-weight: 570;
  fill: var(--detail-ink);
  stroke: var(--detail-ink);
  stroke-width: 0.7px;
  stroke-dasharray: 750;
  stroke-dashoffset: 750;
  fill-opacity: 0;
  clip-path: inset(0 100% 0 0);
}

/* The name writes itself as the arrival blur clears */
.project-detail.is-ready .handwritten text {
  animation: handwrite 1.5s 0.3s both;
}

@keyframes handwrite {
  0% {
    fill-opacity: 0;
    stroke-dashoffset: 750;
    clip-path: inset(0 100% 0 0);
  }
  65% {
    fill-opacity: 0;
  }
  100% {
    fill-opacity: 1;
    stroke-dashoffset: 0;
    clip-path: inset(0);
  }
}

.detail-category {
  margin-top: 28px;
  font-size: 10px;
}

.detail-description {
  margin: 35px 0 56px;
}

.detail-description p {
  font-size: 21px;
  font-weight: 430;
  letter-spacing: -0.4px;
}

.detail-description .button {
  margin-top: 27px;
}

.detail-description .button[hidden],
.detail-facts[hidden],
.detail-media[hidden] {
  display: none;
}

/* Role / technologies / highlights / collaborators */
.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 22px 32px;
  max-width: 880px;
  margin: 30px 0 0;
  padding-top: 24px;
  border-top: 1px solid color-mix(in srgb, var(--detail-ink) 18%, transparent);
}

.detail-facts dt {
  margin-bottom: 7px;
  font-size: 9px;
  color: var(--detail-ink);
  opacity: 0.6;
}

.detail-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--detail-ink);
}

.detail-media {
  max-width: 1040px;
  margin: 0 0 72px;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 30px 70px -30px #0006, 0 0 0 1px #ffffff26;
}

.detail-media img {
  display: block;
  width: 100%;
  height: auto;
}

.detail-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid #5553;
}

.detail-bottom > .mono {
  font-size: 9px;
}

.project-missing {
  padding: 180px 0 100px;
}

.project-missing h1 {
  font-size: 42px;
  letter-spacing: -1.8px;
  margin-bottom: 20px;
}

/* ==========================================================================
   404 page (static: no scripts, so it must never wait for the arrival blur)
   ========================================================================== */

html[data-page="404"].page-arriving::after {
  display: none;
}

.not-found {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  min-height: 100svh;
  padding: 40px 24px;
  text-align: center;
}

.not-found .section-label {
  margin: 0;
}

.not-found h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.not-found p {
  font-size: 15px;
}

.not-found .button {
  margin-top: 10px;
}

/* ==========================================================================
   Reveal — blur + wipe. Only clip-path and filter are animated: liquidGL's
   rasteriser ignores both, so the glass snapshot always holds the final page.
   ========================================================================== */

.reveal-armed [data-reveal]:not(.is-in) {
  clip-path: inset(0 0 100% 0);
  filter: blur(12px);
}

.reveal-armed [data-reveal].is-in:not(.is-done) {
  clip-path: inset(-20% -20% -20% -20%);
  filter: blur(0);
  transition: clip-path 1s var(--ease) var(--d, 0s), filter 1.2s var(--ease) var(--d, 0s);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 1600px) {
  .section {
    padding-block: 130px;
  }
}

@media (max-width: 1100px) {
  .container {
    width: calc(100% - 96px);
  }
  .about-grid {
    gap: 45px;
  }
  .section-heading h2 {
    font-size: 34px;
  }
}

@media (max-width: 1000px) {
  .nav-glass {
    width: calc(100% - 48px);
    padding: 0 12px 0 18px;
  }
  .nav-links ul {
    gap: 0;
  }
  .nav-links a {
    padding: 10px;
    font-size: 13px;
  }
  .nav-contact {
    gap: 10px;
  }
  .phone-stage {
    height: 310px;
  }
  .phone-service h3 {
    font-size: 21px;
  }
  .project-logo-card {
    min-height: 310px;
    padding: 24px;
  }
  .contact-panel {
    inset: 106px 24px auto auto;
  }
}

@media (max-width: 900px) {
  .floating-label {
    display: none;
  }
}

@media (max-width: 760px) {
  .container {
    width: calc(100% - 48px);
  }
  .section {
    padding-top: 76px;
    padding-bottom: 76px;
  }
  .section-heading {
    display: block;
    margin-bottom: 30px;
  }
  .section-heading > p {
    max-width: 350px;
    margin-top: 17px;
    font-size: 13px;
  }
  .section-heading h2 {
    font-size: 32px;
    letter-spacing: -1.3px;
  }
  .nav-links {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .nav-actions {
    margin-left: auto;
  }
  .phone-service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 18px;
  }
  .selection-heading > .mono {
    display: none;
  }
  .project-logo-grid {
    grid-template-columns: 1fr;
  }
  .project-logo-card {
    min-height: 290px;
  }
  .stack-code-grid {
    grid-template-columns: 1fr;
  }
  .stack-code-card pre {
    height: 235px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .about-grid h1 {
    font-size: 45px;
  }
  .about-grid p {
    max-width: 100%;
  }
  .code-window {
    transform: none;
    max-width: 100%;
  }
  .code-body pre {
    font-size: 11px;
  }
  .footer {
    font-size: 9px;
  }
  .footer > span:nth-child(2) {
    margin-right: 15px;
  }
  .detail-brand-row {
    gap: 22px;
  }
  .detail-brand,
  .detail-brand .project-brand {
    width: 85px;
    height: 85px;
  }
  .handwritten {
    width: 70%;
  }
}

@media (max-width: 600px) {
  .nav-anchor {
    top: 14px;
  }
  .nav-glass {
    width: calc(100% - 32px);
    height: 62px;
    padding: 0 8px 0 14px;
    border-radius: 17px;
  }
  .wordmark {
    font-size: 24px;
  }
  .nav-actions {
    gap: 4px;
  }
  .nav-contact {
    gap: 7px;
    padding: 9px 10px;
    font-size: 10px;
  }
  .nav-contact .i {
    width: 13px;
  }
  .mobile-menu {
    top: 70px;
  }
  .hero {
    min-height: 700px;
    max-height: 950px;
  }
  .hero-content {
    width: 100%;
    margin-top: -5px;
    padding: 0 25px;
  }
  .hero-title {
    --title-size: clamp(85px, 23vw, 138px);
    margin-top: 32px;
  }
  .hero-role {
    margin-top: 24px;
    font-size: 16px;
  }
  .hero-lead {
    max-width: 340px;
    margin-top: 25px;
    font-size: 15px;
  }
  .desktop-break {
    display: none;
  }
  .hero-actions {
    gap: 10px;
    margin-top: 26px;
  }
  .button {
    gap: 15px;
    padding: 12px 16px;
    font-size: 12px;
  }
  .hero-bottom {
    bottom: 26px;
  }
  .liquid-background {
    opacity: 0.55;
  }
  .liquid-form {
    animation: none;
  }
  .letter-sparks {
    font-size: 11px;
  }
  .phone-services {
    padding-top: 75px;
    padding-bottom: 70px;
  }
  .phone-service-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .phone-stage {
    height: 360px;
  }
  .phone-service-copy {
    padding-top: 21px;
  }
  .phone-service h3 {
    font-size: 25px;
  }
  .phone-service p {
    max-width: 100%;
  }
  .projects-intro {
    min-height: max(650px, 95svh);
    padding: 150px 20px 100px;
  }
  .section.route-page {
    padding-top: 130px;
    padding-bottom: 65px;
  }
  .about-section.about-route {
    padding-top: 40px;
  }
  .projects-type h1 {
    font-size: clamp(39px, 10.7vw, 64px);
  }
  .projects-intro p {
    font-size: 13px;
  }
  .project-selection {
    padding-top: 60px;
    padding-bottom: 70px;
  }
  .selection-heading {
    margin-bottom: 26px;
  }
  .stack-intro {
    margin-bottom: 40px;
  }
  .stack-intro h1 {
    font-size: clamp(47px, 12vw, 70px);
  }
  .stack-intro p {
    font-size: 12px;
  }
  .stack-card-heading {
    gap: 10px;
    padding: 16px;
  }
  .stack-code-card pre {
    padding: 23px 16px;
    font-size: 10px;
  }
  .contact-panel {
    inset: 90px 16px auto auto;
    padding: 23px;
    max-height: calc(100dvh - 108px);
    border-radius: 24px;
  }
  .contact-panel-head h2 {
    font-size: 23px;
  }
  .contact-secondary img {
    width: 102px;
    height: 102px;
  }
  .contact-secondary > a {
    padding: 14px 8px;
  }
  .detail-content {
    min-height: calc(100svh - 70px);
    padding-top: 126px;
    padding-bottom: 28px;
  }
  .detail-brand-row {
    gap: 16px;
    margin-top: 60px;
  }
  .detail-brand,
  .detail-brand .project-brand {
    width: 65px;
    height: 65px;
  }
  .detail-facts {
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
  }
  .detail-media {
    margin-bottom: 48px;
    border-radius: 16px;
  }
  .detail-category {
    font-size: 8px;
  }
  .detail-description {
    margin-top: 28px;
  }
  .detail-description p {
    font-size: 18px;
  }
  .detail-bottom {
    flex-direction: column;
    align-items: start;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .line-number {
    min-width: 32px;
    padding-right: 12px;
  }
  .code-body pre {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .letter-sparks {
    display: none;
  }
  .phone-render {
    transform: none;
  }
  .handwritten text {
    fill-opacity: 1;
    stroke-dashoffset: 0;
    clip-path: none;
  }
}
