/* ==========================================================================
   larsstalder.ch – gemeinsame Styles für Unterseiten
   (Startseite index.html bleibt self-contained)
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #090909;
  --fg: #f3f2ed;
  --muted: #858581;
  --soft: #a5a59f;
  --line: rgba(243, 242, 237, .12);
  --accent: #d6ff74;
  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

/* --- Hintergrund: Glow + Grain ------------------------------------------- */
.glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse 44rem 35rem at var(--x, 50%) var(--y, 30%), rgba(183, 227, 112, .08), transparent 70%);
}
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
}

/* --- Kopfzeile / Navigation ---------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(20px, 3vw, 36px) var(--pad);
  font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted);
  background: linear-gradient(var(--bg) 35%, rgba(9, 9, 9, 0));
  animation: fade 1s .3s both;
}
.top .home { color: var(--fg); }
.nav { display: flex; gap: clamp(14px, 2.5vw, 34px); }
.nav a { position: relative; transition: color .3s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: .25em; bottom: -7px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) {
  .nav a:hover { color: var(--fg); }
  .nav a:hover::after { transform: scaleX(1); }
}

/* --- Seitenkopf ------------------------------------------------------------ */
main { flex: 1; padding: 0 var(--pad) clamp(60px, 8vw, 120px); }
.head { padding: clamp(40px, 8vw, 110px) 0 clamp(36px, 6vw, 80px); }
.eyebrow {
  display: block; color: var(--accent);
  font-size: clamp(10px, 1vw, 12px); font-weight: 600; letter-spacing: .5em; text-transform: uppercase;
  margin-bottom: clamp(18px, 3vw, 36px); animation: rise 1s .1s both;
}
.title {
  margin: 0; font-size: clamp(3.2rem, 12vw, 11rem); line-height: .85;
  letter-spacing: -.09em; font-weight: 800; text-transform: uppercase; perspective: 1000px;
}
.title .word { display: inline-block; white-space: nowrap; margin-right: .12em; }
.title .outline { color: transparent; -webkit-text-stroke: 1.5px rgba(243, 242, 237, .85); }
.lead {
  max-width: 38rem; margin: clamp(24px, 3vw, 40px) 0 0;
  color: var(--soft); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.6;
  animation: rise 1s .8s both;
}
.lead a { color: var(--fg); border-bottom: 1px solid var(--accent); }

/* --- Buchstaben-Animation (wie Startseite) -------------------------------- */
.letter {
  display: inline-block; transform-origin: 50% 100%;
  animation: letter-in 1.1s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms + 150ms);
  transition: color .4s, transform .5s cubic-bezier(.2, .8, .2, 1), -webkit-text-stroke-color .4s;
}
.letter.ready { animation: none; }
.letter.is-active { color: var(--accent); -webkit-text-stroke-color: var(--accent); transform: translateY(-.08em) rotate(-3deg); }
@media (hover: hover) {
  .letter:hover { color: var(--accent); -webkit-text-stroke-color: var(--accent); transform: translateY(-.08em) rotate(-3deg); }
}

/* --- Scroll-Reveal --------------------------------------------------------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* --- Zeilen-Liste (Projekte & Kontakt) ------------------------------------ */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 10px 24px; align-items: baseline;
  padding: clamp(22px, 3vw, 38px) 0; position: relative;
}
.row::before { /* Akzentlinie, die beim Aktivieren reinläuft */
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease);
}
.r-num { font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.r-name {
  font-size: clamp(1.7rem, 4.4vw, 3.8rem); font-weight: 800; letter-spacing: -.05em;
  text-transform: uppercase; line-height: 1; margin: 0;
  transition: color .35s, transform .6s var(--ease);
}
.r-desc { grid-column: 2; margin: 0; max-width: 44rem; color: var(--soft); font-size: 15px; line-height: 1.55; }
.r-status {
  grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.r-status.live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2.5s ease-in-out infinite;
}
.arrow { display: inline-block; font-size: 1.3em; color: var(--fg); transition: transform .5s var(--ease), color .35s; }
.tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #b5b5af;
  border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px;
}

/* aktiv: Maus-Hover oder (Touch) Zeile in Bildschirmmitte */
a.row:focus-visible { outline: 1px solid var(--accent); outline-offset: 6px; }
@media (hover: hover) {
  a.row:hover::before { transform: scaleX(1); }
  a.row:hover .r-name { color: var(--accent); transform: translateX(.18em); }
  a.row:hover .arrow { color: var(--accent); transform: translate(.15em, -.15em) rotate(0); }
}
@media (hover: none) {
  .is-center > .row::before { transform: scaleX(1); }
  .is-center > .row .r-name { color: var(--accent); transform: translateX(.12em); }
  .is-center > a.row .arrow { color: var(--accent); transform: translate(.12em, -.12em); }
}

@media (max-width: 650px) {
  .top { font-size: 9px; letter-spacing: .14em; }
  .row { grid-template-columns: 2.2rem 1fr; gap: 8px 12px; }
  .r-status { grid-column: 2; grid-row: auto; }
  .eyebrow { letter-spacing: .35em; }
}

/* --- Fusszeile ------------------------------------------------------------- */
.bottom {
  display: flex; justify-content: space-between; align-items: end; gap: 12px;
  padding: 0 var(--pad) clamp(26px, 4vw, 48px);
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: #777771;
}
.cross { font-size: 25px; font-weight: 200; color: var(--accent); line-height: .7; display: inline-block; animation: spin 14s linear infinite; }

/* --- Keyframes ------------------------------------------------------------- */
@keyframes letter-in { from { opacity: 0; transform: translateY(90%) rotateX(-70deg); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .4; box-shadow: 0 0 5px var(--accent); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Work – Laufband, Sticky-Zähler, grosse Hintergrund-Nummern (Mobile)
   ========================================================================== */
.marquee {
  margin: 0 calc(var(--pad) * -1) clamp(48px, 7vw, 110px);
  border-block: 1px solid var(--line); overflow: hidden; background: var(--bg);
  transform: rotate(-1.6deg) scale(1.02);
}
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee span {
  padding: clamp(14px, 2vw, 24px) 0; white-space: nowrap;
  font-size: clamp(1.5rem, 3.6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px rgba(243, 242, 237, .55);
}
.marquee em { font-style: normal; color: var(--accent); -webkit-text-stroke: 0; padding: 0 .55em; display: inline-flex; align-items: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

.work { display: grid; grid-template-columns: minmax(200px, 1fr) 2.4fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.counter { position: sticky; top: clamp(100px, 14vh, 150px); display: flex; flex-direction: column; gap: 16px; perspective: 600px; }
.c-num {
  display: block; font-size: clamp(6rem, 13vw, 13rem); font-weight: 800; line-height: .8; letter-spacing: -.08em;
  color: transparent; -webkit-text-stroke: 1.5px var(--accent);
}
.c-num.flip { animation: flip .7s var(--ease); }
.c-meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.c-name { color: var(--fg); }
@keyframes flip { from { opacity: 0; transform: translateY(35%) rotateX(-65deg); filter: blur(8px); } }

.work .row { isolation: isolate; }
@media (min-width: 901px) { .work .r-num { display: none; } .work .row { grid-template-columns: 1fr auto; } .work .r-desc, .work .tags { grid-column: 1; } .work .r-status { grid-column: 2; } }
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; }
  .counter { display: none; }
  .work .row { grid-template-columns: 1fr; padding-right: 22vw; }
  .work .r-desc, .work .tags, .work .r-status { grid-column: 1; grid-row: auto; }
  .work .r-num {
    position: absolute; right: -.04em; top: 50%; z-index: -1; transform: translateY(-50%);
    font-size: clamp(5rem, 26vw, 9rem); font-weight: 800; letter-spacing: -.08em; line-height: 1;
    color: transparent; -webkit-text-stroke: 1px rgba(243, 242, 237, .14);
    transition: -webkit-text-stroke-color .5s, transform .8s var(--ease);
  }
  .work .is-center .r-num { -webkit-text-stroke-color: var(--accent); transform: translateY(-50%) scale(1.08) rotate(-4deg); }
}

/* ==========================================================================
   Contact – Riesen-E-Mail zum Kopieren
   ========================================================================== */
.mail { margin-bottom: clamp(48px, 7vw, 100px); }
.mail-big {
  all: unset; cursor: copy; display: block; width: 100%;
  font-size: clamp(2rem, 8.4vw, 10.5rem); font-weight: 800; line-height: .95; letter-spacing: -.065em;
  -webkit-user-select: none; user-select: none;
}
.mail-big .word { display: inline-block; white-space: nowrap; }
.mail-big .outline { color: transparent; -webkit-text-stroke: 1.5px rgba(243, 242, 237, .85); }
.mail-big:focus-visible { outline: 1px solid var(--accent); outline-offset: 8px; }
.mail-actions {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: clamp(20px, 3vw, 36px);
  padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--muted);
}
.mail-actions a { color: var(--fg); transition: color .3s; }
.mail-actions a:hover, .mail-actions a:focus-visible { color: var(--accent); outline: none; }
.toast {
  position: fixed; left: 50%; bottom: clamp(24px, 6vh, 56px); z-index: 60;
  padding: 14px 22px; border-radius: 99px; background: var(--accent); color: var(--bg);
  font-size: 11px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase;
  opacity: 0; transform: translate(-50%, calc(100% + 80px)); transition: transform .6s var(--ease), opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 650px) {
  .mail-big { font-size: 15.5vw; }
  .mail-big .word { display: block; }
}

/* --- Icons (SVG statt ✳/↗ – iOS zeigt diese Zeichen sonst als Emoji) --- */
.ico { display: inline-block; width: 1em; height: 1em; vertical-align: -.14em; flex: none; }
.cross .ico { width: 22px; height: 22px; vertical-align: middle; }
.marquee em .ico { width: .7em; height: .7em; vertical-align: .05em; }
.arrow .ico { width: .8em; height: .8em; }
.mail-actions a .ico { width: 1.1em; height: 1.1em; margin-left: .3em; vertical-align: -.25em; }

/* Kontakt: Zeile ohne Nummer, Pfeil bleibt rechts */
.row--simple { grid-template-columns: 1fr auto !important; }
.row--simple .r-desc { grid-column: 1; }
.row--simple .r-status { grid-column: 2 !important; grid-row: 1 !important; }
.row--simple .arrow { font-size: clamp(1.8rem, 4.4vw, 3.6rem); }
