/* gillesgoetsch.ch — 2026 build · dark, modern, noisy */

:root {
  --bg:        #0A0A0B;
  --bg-deep:   #050506;
  --fg:        #F2F0EC;
  --fg-dim:    #9C9A95;
  --fg-low:    #4A4843;
  --line:      #25241F;
  --line-soft: #1B1A16;
  --accent:    #D7FF00;
  --accent-d:  #A8C800;

  --serif:     'Geist', 'Inter', system-ui, sans-serif;
  --mono:      'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  --pad-x:     clamp(1.25rem, 3vw, 3rem);
  --ease:      cubic-bezier(.2, .8, .2, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

::selection { background: var(--accent); color: var(--bg); }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "ss02" 1;
  overflow-x: hidden;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }

.skip {
  position: absolute; left: -9999px;
  background: var(--fg); color: var(--bg);
  padding: .5em .8em;
  font: 500 .75rem/1 var(--mono);
}
.skip:focus { left: 1rem; top: 1rem; z-index: 999; }

/* =========================================================
   Layered canvases + vignette
   ========================================================= */
#webgl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
#webgl-row {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);  /* fully clipped (hidden) by default */
  transition: clip-path .35s var(--ease);
}
#grain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 3;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: overlay;
}
.vignette {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 40%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 12%, transparent 88%, rgba(0,0,0,.45) 100%);
}

main, .nav { position: relative; z-index: 4; }

/* Isolate the hero so the name's mix-blend-mode: difference does NOT pick up
   the WebGL canvas behind it (otherwise the name shows blue patches wherever
   wireframes intersect the letters). The .v::before negative-blend still
   works because the ventures section is outside .hero. */
.hero { isolation: isolate; }

/* =========================================================
   Custom cursor
   ========================================================= */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  a, button, [data-magnetic] { cursor: none; }

  .cursor {
    position: fixed; left: 0; top: 0;
    width: 0; height: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s var(--ease);
  }
  .cursor.is-visible { opacity: 1; }
  .cursor-ring {
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--fg);
    transition: width .25s var(--ease), height .25s var(--ease), background .2s var(--ease);
    mix-blend-mode: difference;
  }
  .cursor.is-link .cursor-ring {
    width: 72px; height: 72px;
    background: var(--accent);
  }
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 1.25rem var(--pad-x);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  z-index: 50;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font: 700 1.1rem/1 var(--serif);
  letter-spacing: -.04em;
  color: var(--fg);
}
.logo-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-top: 2px;
}

.nav-meta {
  display: flex;
  gap: 1.6rem;
  justify-content: flex-end;
  font: 500 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--fg-dim);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  transition: color .4s var(--ease);
}
.status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.status[data-state="green"] .dot {
  background: #6EE76E;
  box-shadow: 0 0 12px rgba(110, 231, 110, .6);
  animation: pulse 2.2s ease-in-out infinite;
}
.status[data-state="amber"] .dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(215, 255, 0, .5);
  animation: pulse 3.4s ease-in-out infinite;
}
.status[data-state="grey"] .dot {
  background: #555;
  box-shadow: none;
}
.status[data-state="grey"] { color: var(--fg-low); }
.status-label { letter-spacing: .12em; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
.time { font-variant-numeric: tabular-nums; min-width: 7ch; text-align: right; color: var(--fg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  min-height: 100dvh;
  padding: 7rem var(--pad-x) 3rem;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 1.5rem;
  position: relative;
}

.name {
  align-self: center;
  font-family: var(--serif);
  font-size: clamp(3.5rem, 16vw, 15rem);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.05em;
  text-transform: uppercase;
  color: var(--fg);
  mix-blend-mode: difference;
  white-space: nowrap;
}
.name .line { display: block; overflow: hidden; }
.name .line span { display: inline-block; white-space: nowrap; }

.lead {
  align-self: end;
  font-size: clamp(.95rem, .35vw + .85rem, 1.15rem);
  line-height: 1.5;
  max-width: 36ch;
  color: var(--fg-dim);
  margin-bottom: .5rem;
}
.lead a.inline {
  color: var(--fg);
  border-bottom: 1px solid var(--fg-low);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.lead a.inline:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font: 500 .75rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: .9em;
  padding: .9em 1.2em .9em 1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(2px);
}
.cta:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.cta-num { color: var(--accent); font-size: .7rem; }
.cta:hover .cta-num { color: var(--bg); }
.cta-arrow { transition: transform .35s var(--ease); }
.cta:hover .cta-arrow { transform: translateY(.18em); }

.hero-coord { color: var(--fg-dim); }

/* =========================================================
   Index / Ventures
   ========================================================= */
.index {
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x) clamp(6rem, 12vh, 9rem);
  position: relative;
}

.index-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.label {
  font: 500 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--fg-dim);
}
.label.dim { color: var(--fg-low); }

.ventures {
  list-style: none;
}
.ventures li { border-bottom: 1px solid var(--line); }

.v {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto auto;
  grid-template-rows: auto;
  align-items: baseline;
  gap: 1.5rem;
  padding: clamp(1.5rem, 2.5vw, 2.4rem) 0;
  position: relative;
  transition: padding .35s var(--ease), color .25s var(--ease);
}
.v::before {
  content: "";
  position: absolute;
  inset: 0 -2rem;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform .5s var(--ease);
  /* z 1 in main's SC. canvas-row sits at z 2 (above the yellow tint) so its
     dark-wireframe pixels render as silhouettes inside the row. Text is at z 3
     to remain on top of everything. */
  z-index: 1;
  pointer-events: none;
}
.v > * {
  position: relative;
  z-index: 3;
}
.v:hover, .v.is-hovering { padding-left: 1.5rem; padding-right: 1.5rem; color: var(--bg); }
.v:hover::before, .v.is-hovering::before { transform: scaleY(1); transform-origin: top center; }

.v-num {
  font: 500 .85rem/1 var(--mono);
  letter-spacing: .12em;
  color: var(--fg-dim);
  transition: color .25s var(--ease);
}
.v:hover .v-num { color: var(--bg); }

.v-name {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.5vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1;
  transition: font-weight .35s var(--ease);
}
.v:hover .v-name { font-weight: 800; }

.v-meta {
  font: 500 .8rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--fg-dim);
  transition: color .25s var(--ease);
}
.v:hover .v-meta { color: rgba(10,10,11,.7); }

.v-domain {
  font: 500 .8rem/1 var(--mono);
  letter-spacing: .04em;
  color: var(--fg);
  transition: color .25s var(--ease);
}
.v:hover .v-domain { color: var(--bg); }

.v-arrow {
  font: 500 1.6rem/1 var(--serif);
  color: var(--fg-dim);
  transition: transform .4s var(--ease), color .25s var(--ease);
}
.v:hover .v-arrow {
  color: var(--bg);
  transform: translate(.2em, -.2em);
}

/* =========================================================
   Contact
   ========================================================= */
.contact {
  padding: clamp(6rem, 14vh, 10rem) var(--pad-x) clamp(4rem, 8vh, 6rem);
  border-top: 1px solid var(--line);
}

.contact .label {
  margin-bottom: clamp(2rem, 6vh, 4rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.contact-title {
  font-size: clamp(3.5rem, 10vw, 11rem);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.05em;
  text-transform: uppercase;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.contact-title span { display: block; }
.contact-title span:last-child {
  color: var(--accent);
  font-style: normal;
}

.lines { list-style: none; }
.lines li {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.lines li:first-child { border-top: 1px solid var(--line); }
.lines-key {
  font: 500 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--fg-dim);
}
.lines a {
  display: inline-flex;
  align-items: baseline;
  gap: .5em;
  font-size: clamp(1.4rem, 1.5vw + .8rem, 2.4rem);
  font-weight: 500;
  letter-spacing: -.025em;
  color: var(--fg);
  transition: color .25s var(--ease);
}
.lines a:hover { color: var(--accent); }
.lines a .ar { transition: transform .35s var(--ease); display: inline-block; font-size: .7em; }
.lines a:hover .ar { transform: translate(.2em, -.2em); }
.lines-val {
  font-size: clamp(1.4rem, 1.5vw + .8rem, 2.4rem);
  font-weight: 500;
  letter-spacing: -.025em;
  color: var(--fg-dim);
}

.portrait {
  position: relative;
  filter: contrast(1.04) saturate(1.05);
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}
.portrait figcaption {
  margin-top: .8rem;
  display: flex;
  align-items: center;
  gap: .5em;
  font: 500 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--fg-dim);
}
.ar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* =========================================================
   Footer
   ========================================================= */
.foot {
  padding: 2rem var(--pad-x);
  border-top: 1px solid var(--line);
  font: 500 .72rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--fg-dim);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: center;
}
.foot-grid > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-back { text-align: right; }
.foot-back a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.foot-back a:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================
   Reveal animations (JS-gated)
   ========================================================= */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
html.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

html.js [data-text] {
  display: inline-block;
  overflow: hidden;
}
html.js [data-text] .char {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.2s var(--ease-out);
}
html.js [data-text].is-in .char {
  transform: translateY(0);
}

/* Flat mode — only used for full-page debug screenshots */
body.flat-mode .hero { min-height: auto; padding-bottom: 6rem; }
body.flat-mode .index, body.flat-mode .contact { padding-top: 5rem; padding-bottom: 5rem; }

/* =========================================================
   3D warp / glitch on background during state transitions
   ========================================================= */
#webgl { transition: filter .25s ease-out, transform .25s ease-out; }

body.bg-warp #webgl {
  animation: bgWarp .46s cubic-bezier(.2,.8,.2,1);
}
@keyframes bgWarp {
  0%   { transform: scale(1) translateZ(0); filter: brightness(1) contrast(1) hue-rotate(0); }
  18%  { transform: scale(1.06) translateZ(0); filter: brightness(1.45) contrast(1.25) hue-rotate(-12deg); }
  45%  { transform: scale(.985) translateZ(0); filter: brightness(.85) contrast(1.4) hue-rotate(8deg); }
  72%  { transform: scale(1.012) translateZ(0); filter: brightness(1.12) contrast(1.1) hue-rotate(-2deg); }
  100% { transform: scale(1) translateZ(0); filter: brightness(1) contrast(1) hue-rotate(0); }
}

body.bg-warp .vignette {
  animation: vignWarp .46s ease-out;
}
@keyframes vignWarp {
  0%   { opacity: 1; }
  20%  { opacity: .35; }
  100% { opacity: 1; }
}

/* Make hovered venture row tag the background with its key — used as a hint when JS hover wires up */
.v[data-bg] { transition: background .25s ease; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 920px) {
  .contact-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 360px; }
  .lines li { grid-template-columns: 8rem 1fr; gap: 1rem; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-back { text-align: left; grid-column: 1 / -1; padding-top: .5rem; border-top: 1px solid var(--line); margin-top: .5rem; }
}

@media (max-width: 640px) {
  .nav { padding: 1rem var(--pad-x); }
  .nav-meta { gap: 1rem; font-size: .62rem; }
  .nav-meta .loc { display: none; }
  .nav-meta .status .status-label { display: none; }
  .nav-meta .status { gap: 0; }

  .hero { padding-top: 6rem; gap: 1.25rem; }
  .eyebrow { font-size: .62rem; gap: .5em; }
  .name { letter-spacing: -.05em; }

  .v {
    grid-template-columns: 2.2rem 1fr auto;
    grid-template-rows: auto auto;
    gap: .6rem;
    padding: 1.2rem 0;
  }
  .v-num { grid-column: 1; grid-row: 1; padding-top: .25em; }
  .v-name {
    grid-column: 2;
    grid-row: 1;
    font-size: clamp(1.6rem, 7.5vw, 2.4rem);
    line-height: 1;
  }
  .v-meta { display: none; }
  .v-domain { grid-column: 2; grid-row: 2; font-size: .65rem; }
  .v-arrow { grid-column: 3; grid-row: 1; align-self: start; padding-top: .25em; }
  .v:hover { padding-left: .5rem; padding-right: .5rem; }
  .v::before { inset: 0 -.8rem; }

  .contact-title { font-size: clamp(3rem, 16vw, 6rem); }
  .lines li { grid-template-columns: 1fr; gap: .25rem; }
  .lines-key { font-size: .6rem; }
  .lines a { font-size: clamp(1.2rem, 5.5vw, 2rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  #webgl { display: none; }
  #grain { display: none; }
}
