/* ============================================================
   Homepage – fluid / responsive rewrite
   No Tailwind needed. Layout uses flow, grid, flex and clamp().
   ============================================================ */

@font-face {
  font-family: "Hydrogenous";
  src: url("Hydrogenous.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Quest";
  src: url("Questrial-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Mont";
  src: url("Montserrat-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --muted: #e9e9e9;
  --mint: #cffafe;
  --max: 1400px;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --gap: clamp(1.5rem, 5vw, 5rem);
  --display: "Hydrogenous", "Mont", system-ui, sans-serif;
  --body: "Mont", "Montserrat", system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

a:focus-visible, button:focus-visible {
  outline: 3px solid #0ea5e9;
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 3000;
  padding: 0.6rem 1rem;
  background: var(--ink); color: var(--paper);
}
.skip-link:focus { top: 1rem; }

.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;
}

/* ---------- Loader ---------- */
.loader {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  place-items: center;
  background: var(--paper);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
html.js .loader { display: grid; }
html.loaded .loader { opacity: 0; visibility: hidden; }

.loader svg {
  width: clamp(4rem, 11vw, 9rem);
  height: clamp(4rem, 11vw, 9rem);
  overflow: visible;
  transform: rotate(45deg);
}
.loader polyline {
  stroke-width: 4;
  stroke-linejoin: miter;     /* sharp corners on the left, right and bottom */
  stroke-linecap: square;     /* square ends fill the notch where the two halves meet at the top and bottom points */
}
.stroke-still { stroke: #e1e1e1; }
.stroke-animation {
  stroke: #000;
  animation: stroke-spacing 1.2s ease-in infinite;
  transform-origin: center;
}
@keyframes stroke-spacing {
  0%   { stroke-dasharray: 0 200; }
  45%  { stroke-dashoffset: 0;    stroke-dasharray: 200 200; }
  90%  { stroke-dashoffset: -200; stroke-dasharray: 200 200; }
  100% { stroke-dashoffset: -200; stroke-dasharray: 200 200; }
}

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  display: flex; justify-content: center;
  padding: clamp(0.6rem, 2vw, 1.5rem) clamp(0.75rem, 2vw, 2rem);
  pointer-events: none;
}
.site-nav__bar {
  pointer-events: auto;
  width: min(100%, 1800px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
  padding: 0.55rem clamp(1rem, 2.5vw, 2rem);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-family: var(--display);
  transition: background 0.4s ease, color 0.4s ease;
}
.site-nav.scrolled .site-nav__bar { background: var(--ink); color: var(--paper); }

.site-nav__logo {
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__links {
  display: none;
  gap: clamp(0.5rem, 2vw, 2.5rem);
  font-size: clamp(0.95rem, 1.45vw, 1.3rem);
}
.site-nav__links a,
.site-nav__logo {
  text-decoration: none;
  padding: 0.5rem clamp(0.75rem, 1.3vw, 1.4rem);
  border-radius: 999px;
  /* background + shadow transition (not opacity, so it doesn't fight the load animation) */
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-nav__logo { margin-left: calc(-1 * clamp(0.75rem, 1.3vw, 1.4rem)); }

/* "Hole" hover: a lighter, recessed pill pressed into the bar */
.site-nav__links a:hover, .site-nav__links a:focus-visible,
.site-nav__logo:hover,    .site-nav__logo:focus-visible {
  background-color: #e4e4e4;
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.32), inset 0 -1px 0 rgba(255, 255, 255, 0.8);
  outline: none;
}
/* once the bar turns black, the hole is a lighter gray than the bar */
.site-nav.scrolled .site-nav__links a:hover, .site-nav.scrolled .site-nav__links a:focus-visible,
.site-nav.scrolled .site-nav__logo:hover,    .site-nav.scrolled .site-nav__logo:focus-visible {
  background-color: #3a3a3a;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.menu-btn {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  background: transparent; color: inherit;
  border: 2px solid currentColor; border-radius: 0.5rem;
  cursor: pointer;
}
.menu-btn svg { width: 1.4rem; height: 1.4rem; }

@media (min-width: 800px) {
  .site-nav__links { display: flex; }
  .menu-btn { display: none; }
}

/* Load-in animation (only when JS is on; starts once the loader fades) */
html.js .site-nav__bar { opacity: 0; transform: translateY(-1.5rem); clip-path: inset(0 50% 0 50% round 999px); }
html.loaded .site-nav__bar {
  animation: nav-bar-in 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}
html.js .site-nav__logo,
html.js .site-nav__links a,
html.js .menu-btn { opacity: 0; transform: translateY(-0.75rem); }
html.loaded .site-nav__logo,
html.loaded .site-nav__links a,
html.loaded .menu-btn {
  animation: nav-item-in 0.6s ease forwards;
  animation-delay: calc(0.7s + var(--i, 0) * 0.09s);
}
.site-nav__logo { --i: 0; }
.site-nav__links a:nth-child(1) { --i: 1; }
.site-nav__links a:nth-child(2) { --i: 2; }
.site-nav__links a:nth-child(3) { --i: 3; }
.site-nav__links a:nth-child(4) { --i: 4; }
.site-nav__links a:nth-child(5) { --i: 5; }
.menu-btn { --i: 1; }
@keyframes nav-bar-in {
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 999px); }
}
@keyframes nav-item-in {
  to { opacity: 1; transform: none; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad);
  background: var(--ink); color: var(--mint);
  font-family: var(--body);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-menu__close {
  position: absolute; top: 1rem; right: 1rem;
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  background: transparent; color: inherit;
  border: 2px solid currentColor; border-radius: 0.5rem;
  font-size: 1.4rem; cursor: pointer;
}
.mobile-menu li + li { margin-top: clamp(1.25rem, 6vh, 2.5rem); }
.mobile-menu a {
  display: inline-block;
  font-size: clamp(2.2rem, 10vw, 3.75rem);
  font-weight: 300;
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;                 /* whole first screen: text + scroll cue always fit */
  padding: clamp(5.5rem, 12vw, 8rem) var(--pad) clamp(0.75rem, 2vw, 1.5rem);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hero__words {
  position: relative; z-index: 1;
  width: fit-content; max-width: 100%;
  margin-inline: auto;               /* centres the whole staggered block */
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 12vw, 4.5rem);   /* phone */
  line-height: 1.08;
  letter-spacing: 0.01em;
}
.hero__word {
  display: block;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}
@media (min-width: 700px) {
  .hero__words { font-size: clamp(3.5rem, 11vw, 12rem); }  /* fallback; JS fits it exactly */
  .hero__word:nth-child(1) { margin-left: 0.15em; }
  .hero__word:nth-child(2) { margin-left: 0.9em; }
  .hero__word:nth-child(3) { margin-left: 0.4em; }
}
@media (max-width: 699px) {
  .hero__words { font-size: 12vw; }
}

/* typing reveal (only when JS is on, so no-JS visitors still see text) */
html.js .hero__word { clip-path: inset(0 100% 0 0); }
html.loaded .hero__word {
  animation: reveal 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.25s);
}
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }

/* Stage = the text block. The slash is anchored to its centre so it always
   cuts diagonally through the words, at every screen size. */
.hero__stage {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin: auto;                          /* centred in the space above the scroll cue */
  top: calc(-1 * var(--lift, clamp(1rem, 6vh, 4rem)));   /* nudged up; JS sets --lift to fit the screen */
}
.hero__slash {
  position: absolute; z-index: 2;
  left: 50%; top: 50%;
  width: clamp(0.6rem, 2.2vw, 2.25rem);
  height: 170%;                      /* long enough to span every line at 45deg */
  background: var(--ink);
  transform: translate(-50%, -50%) rotate(45deg) scaleX(1);
  pointer-events: none;
}
/* Where the bar crosses the black letters, flip them to white */
@supports (mix-blend-mode: difference) {
  .hero__slash { background: #fff; mix-blend-mode: difference; }
}
html.js .hero__slash { transform: translate(-50%, -50%) rotate(45deg) scaleX(0); }
html.loaded .hero__slash { animation: slash 1.6s cubic-bezier(0.65, 0, 0.35, 1) 1.6s forwards; }
@keyframes slash { to { transform: translate(-50%, -50%) rotate(45deg) scaleX(1); } }


/* ---------- Scroll cue ---------- */
.scroll-cue {
  position: relative; z-index: 3;       /* in the flow, so it can never overlap the text */
  align-self: center;
  margin-top: clamp(0.5rem, 2vw, 1.25rem);
  display: grid; justify-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--display);
  font-size: 0.8rem; letter-spacing: 0.3em;
  transition: opacity 0.4s ease;
}
.scroll-cue__arrow {
  width: 1.1rem; height: 1.9rem;
  animation: cue-bounce 1.8s ease-in-out infinite;
}
@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(0.5rem); opacity: 0.45; }
}
html.js .scroll-cue { opacity: 0; pointer-events: none; }
html.loaded .scroll-cue { opacity: 1; pointer-events: auto; transition-delay: 2.6s; }
html.loaded .scroll-cue.is-hidden { opacity: 0; pointer-events: none; transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue__arrow { animation: none; }
}

/* ---------- Shared section heads ---------- */
.section {
  width: min(100% - 2 * var(--pad), var(--max));
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 7rem) 0;
}
.section__head {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 200;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ink);
}

/* ---------- About ---------- */
.about {
  margin-top: clamp(0rem, 3vw, 2rem);
  padding: clamp(6rem, 18vw, 17rem) var(--pad) clamp(3.5rem, 8vw, 6rem);   /* room so the text clears the curve */
  background: var(--ink); color: #fff;
  border-radius: 50% 50% 0 0 / clamp(3rem, 20vw, 20rem) clamp(3rem, 20vw, 20rem) 0 0;   /* taller curve = rounder dome */
}
.about__inner {
  max-width: var(--max); margin-inline: auto;
  display: grid; gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 900px) {
  .about__inner { grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); }
  .about__col { grid-column: 2; }
}
.about__text {
  font-weight: 200;
  font-size: clamp(1.1rem, 2.1vw, 2rem);
  line-height: 1.55;
}
.about__title {
  font-weight: 200;
  font-size: clamp(2rem, 4.5vw, 4rem);
  line-height: 1;
}
@media (min-width: 900px) {
  .about__title { position: sticky; top: 7rem; align-self: start; }
}

/* ---------- Experience (interactive tabs) ---------- */
.xp {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid #fff;
  container-type: inline-size;
}
.xp__title {
  padding: 1rem 0;
  font-weight: 300;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
}
.xp__layout { display: grid; gap: 1.5rem; }

.xp__tabs {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.xp__tabs::-webkit-scrollbar { display: none; }
.xp__tab {
  flex: none; scroll-snap-align: start;
  display: grid; gap: 0.25rem; text-align: left;
  margin: 0 1.5rem -1px 0; padding: 0.75rem 0 0.9rem;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: #fff; font-family: var(--body);
  opacity: 0.5; cursor: pointer;
  transition: opacity 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.xp__tab:hover { opacity: 0.85; }
.xp__tab[aria-selected="true"] { opacity: 1; border-bottom-color: #fff; }
.xp__date { font-weight: 200; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.xp__org  { font-weight: 600; font-size: clamp(0.95rem, 1.4vw, 1.15rem); white-space: nowrap; }

/* wide column: tabs become a vertical rail on the left */
@container (min-width: 44rem) {
  .xp__layout { grid-template-columns: 13rem minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); }
  .xp__tabs {
    flex-direction: column; overflow: visible;
    border-bottom: 0; border-left: 1px solid rgba(255, 255, 255, 0.25);
  }
  .xp__tab {
    margin: 0 0 0 -1px; padding: 0.9rem 0 0.9rem 1.25rem;
    border-bottom: 0; border-left: 2px solid transparent;
  }
  .xp__tab[aria-selected="true"] { border-left-color: #fff; transform: translateX(0.25rem); }
}

.xp__panels { min-width: 0; padding-top: 0.5rem; }
.xp__panel { display: none; }
.xp__panel.is-active { display: block; animation: xp-in 0.5s ease both; }
@keyframes xp-in { from { opacity: 0; transform: translateY(0.75rem); } to { opacity: 1; transform: none; } }
html:not(.js) .xp__panel { display: block; margin-bottom: 2rem; }
html:not(.js) .xp__tabs { display: none; }

.xp__top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.xp__role { font-weight: 300; font-size: clamp(1.3rem, 2.2vw, 1.9rem); }
.xp__where { margin-top: 0.3rem; margin-bottom: 1.25rem; font-weight: 200; font-size: clamp(0.9rem, 1.3vw, 1.05rem); opacity: 0.75; }

.xp__list { font-weight: 200; font-size: clamp(0.9rem, 1.3vw, 1.05rem); line-height: 1.65; }
.xp__list li { position: relative; padding-left: 1.1rem; margin-bottom: 0.85rem; transition: opacity 0.25s; }
.xp__list li::before { content: "–"; position: absolute; left: 0; }
.xp__panel.is-active .xp__list li { animation: xp-in 0.5s ease both; animation-delay: calc(var(--n, 0) * 0.09s + 0.12s); }
@media (hover: hover) {
  .xp__list:hover li { opacity: 0.4; }
  .xp__list li:hover { opacity: 1; }
}

/* ---------- Technical Skills ---------- */
.tech {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.5vw, 2rem);
}
.tech > li {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: clamp(1.25rem, 3vw, 2rem);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.tech__name {
  width: fit-content; max-width: 100%;
  font-weight: 300;                       /* phones */
  font-size: clamp(1.75rem, 4vw, 3.25rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
@media (min-width: 700px) { .tech__name { font-weight: 600; } }
.tech__chips {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
}
.tech__chips li {
  padding: 0.45rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  font-weight: 400;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.2;
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
@media (min-width: 800px) {
  .tech { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* offset the right-hand cards for a little rhythm */
  .tech > li:nth-child(even) { transform: translateY(clamp(0.5rem, 3vw, 2.5rem)); }
}
@media (hover: hover) {
  .tech > li:hover { border-color: var(--ink); }
  .tech__name { transition: color 0.2s; cursor: default; }
  .tech > li:hover .tech__name { color: #fff; -webkit-text-stroke: 1.5px #000; }   /* white fill, black outline */
  .tech__chips li:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
}

/* ---------- Portfolio ---------- */
.works__title {
  margin: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 4rem);
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 4.5rem);
}
@media (min-width: 900px) { .works__title { margin-left: 15%; } }

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 6vw, 5rem) var(--gap);
}
@media (min-width: 700px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid .project:nth-child(even) { margin-top: clamp(1rem, 7vw, 7rem); } /* zig-zag */
}

.project { display: block; color: var(--ink); transition: filter 0.35s ease; }
.project__link { display: block; color: inherit; text-decoration: none; }
.project__thumb {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  padding: 12%;
  background: var(--muted);
  border-radius: clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
}
.project__thumb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: saturate(0);
  transition: filter 0.4s ease, transform 0.6s ease;
}
.project:hover .project__thumb img,
.project__link:focus-visible .project__thumb img,
.project.is-match .project__thumb img {
  filter: none; transform: scale(1.08);
}
.project__info { margin-top: 1rem; }
.project__title {
  font-weight: 200;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.project__tags {
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  letter-spacing: 0.04em;
}
.project__hashtags {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.tag {
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.project:hover .tag { border-color: var(--ink); }
@media (hover: hover) {
  .tag:hover { background: rgba(0, 0, 0, 0.08); }
}
/* selected keyword: filled on every card that shows it */
.tag[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* single-out: non-matching projects fade back */
.project.is-dim { filter: grayscale(1) opacity(0.22); }
.project.is-match .project__title { font-weight: 500; }

.work-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  padding: 0.75rem 1.25rem;
  background: var(--muted);
  border-radius: 999px;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
}
.work-status[hidden] { display: none; }
.work-status__clear {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: none; border: 0; color: inherit;
  font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(3rem, 8vw, 6rem); }
.contact__cta {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  font-weight: 500;
  font-size: clamp(2.8rem, 13vw, 13rem);
  line-height: 1;
  overflow-wrap: anywhere;
}
.contact__links {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  display: grid; gap: clamp(0.5rem, 1.5vw, 1.25rem);
  text-align: center;
  font-weight: 300;
  font-size: clamp(1.3rem, 4vw, 3.2rem);
}
.contact__links a { display: inline-block; padding: 0.35rem 0; text-decoration: none; }
.contact__links a:hover { font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; }
.contact__mail {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  text-align: center;
  font-family: var(--display);
  font-size: clamp(0.9rem, 2vw, 1.3rem);
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}
.contact__mail a { text-decoration: none; }
.contact__mail a:hover { text-decoration: underline; }

/* ---------- Side rails (wide screens only) ---------- */
.rail-left, .rail-right { display: none; }

@media (min-width: 1100px) {
  .rail-left {
    position: fixed; left: clamp(1rem, 2.4vw, 2.5rem); bottom: 0; z-index: 800;
    display: flex; flex-direction: column; align-items: center;
    gap: 1.1rem; padding-bottom: 6rem;
  }
  .rail-left::after, .rail-right::after {
    content: ""; position: absolute; bottom: 0; left: 50%;
    width: 1px; height: 5rem; background: currentColor;
  }
  .rail-left a { line-height: 0; }
  .rail-left img { width: 1.4rem; height: 1.4rem; transition: filter 0.3s; }

  .rail-right {
    position: fixed; right: clamp(1rem, 2.4vw, 2.5rem); bottom: 0; z-index: 800;
    display: block; padding-bottom: 6rem;
    writing-mode: vertical-rl;
    font-family: var(--display); font-size: 0.9rem; letter-spacing: 0.2em;
  }
  .rail-right a { text-decoration: none; }
  .rail-left, .rail-right { color: var(--ink); transition: color 0.3s, opacity 1s; }
  html.js .rail-left, html.js .rail-right { opacity: 0; }
  html.loaded .rail-left, html.loaded .rail-right { opacity: 1; transition-delay: 1.5s; }

  body.on-dark .rail-left, body.on-dark .rail-right { color: #fff; }
  body.on-dark .rail-left img { filter: invert(1); }
}

/* ---------- Scroll reveal ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  transition: opacity 0.9s ease, transform 0.9s ease, filter 0.35s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}
