/* sonraich — experience stylesheet */

:root {
  --bg: #cacaca;
  --ink: #161616;
  --ink-soft: #3d3d3d;
  --muted: #696969;
  --hairline: #b0b0b0;
  --accent: #4C7695;
  --dark: #131313;
  --dark-ink: #e8e8e8;
  --dark-muted: rgba(255,255,255,0.45);
  --font-display: "Barlow", sans-serif;
  --font-cond: "Barlow Condensed", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

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

html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #898989; border-radius: 2px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Loader ── */
#loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--dark);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 18px;
}
#loader .loader-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.4rem);
  color: var(--dark-ink);
  letter-spacing: -0.02em;
  overflow: hidden;
}
#loader .loader-word span { display: inline-block; transform: translateY(110%); }
#loader .loader-count {
  font-family: var(--font-cond);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--dark-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Custom cursor ── */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 150;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--ink);
  mix-blend-mode: difference;
  background: #e8e8e8;
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(232,232,232,0.65);
  mix-blend-mode: difference;
  display: flex; align-items: center; justify-content: center;
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.cursor-ring .cursor-label {
  font-family: var(--font-cond);
  font-size: 0px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--dark);
  opacity: 0;
  transition: opacity 0.2s ease, font-size 0.2s ease;
  text-transform: lowercase;
}
.cursor-ring.has-label {
  width: 74px; height: 74px;
  background: #e8e8e8;
  border-color: transparent;
}
.cursor-ring.has-label .cursor-label { opacity: 1; font-size: 12px; }
@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}
html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }

/* ── Top bar ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 32px;
  mix-blend-mode: difference;
  color: #e8e8e8;
  pointer-events: none;
}
.topbar .wordmark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em;
  pointer-events: auto;
}
.topbar .topbar-mail {
  font-family: var(--font-cond);
  font-size: 12px; letter-spacing: 0.14em;
  pointer-events: auto;
}

/* ── Side nav ── */
.sidenav {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
  width: 92px;
  display: flex; flex-direction: column;
  justify-content: center; gap: 14px;
  padding-left: 32px;
  mix-blend-mode: difference;
}
.sidenav a {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-cond);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(232,232,232,0.38);
  transition: color 0.25s ease;
  line-height: 1;
}
.sidenav a .nav-idx { font-size: 9px; letter-spacing: 0.08em; }
.sidenav a.active, .sidenav a:hover { color: #e8e8e8; }
.sidenav a .nav-tick {
  width: 0px; height: 1px; background: #e8e8e8;
  display: inline-block; vertical-align: middle;
  transition: width 0.25s ease;
}
.sidenav a.active .nav-tick { width: 14px; }

/* ── Sections base ── */
.section { position: relative; }
.section-inner {
  padding-left: 140px;
  padding-right: 72px;
  max-width: 1640px;
}

.sect-label {
  font-family: var(--font-cond);
  font-weight: 600; font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.sect-label::after {
  content: ''; height: 1px; width: 64px; background: var(--accent); opacity: 0.4;
  display: inline-block;
}

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
#terrain-canvas {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}
#hero .section-inner { position: relative; z-index: 1; width: 100%; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 12.5vw, 12rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-transform: lowercase;
}
.hero-title .line { overflow: hidden; display: block; }
.hero-title .line > span { display: block; transform: translateY(112%); }
.hero-title .co { color: var(--muted); }
.hero-sub {
  margin-top: 38px;
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  opacity: 0;
}
.hero-sub p {
  font-family: var(--font-body);
  font-size: 14px; color: var(--ink-soft);
  letter-spacing: 0.02em;
  max-width: 380px; line-height: 1.6;
}
.hero-scroll {
  position: absolute; bottom: 30px; left: 140px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-cond);
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--muted);
  opacity: 0;
}
.hero-scroll .scroll-line {
  width: 1px; height: 36px; background: var(--muted);
  transform-origin: top;
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll .scroll-line { animation: none; }
}
@keyframes scrollPulse {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 12px;
  letter-spacing: 0.12em; text-transform: lowercase;
  color: var(--ink);
  border: 1px solid rgba(0,0,0,0.3);
  padding: 14px 26px;
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}
.btn .btn-fill {
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform 0.35s cubic-bezier(0.6, 0, 0.3, 1);
  z-index: -1;
}
.btn:hover { color: #fff; border-color: var(--accent); }
.btn:hover .btn-fill { transform: scaleY(1); }
.btn.btn-dark { color: var(--dark-ink); border-color: rgba(255,255,255,0.3); }
.btn.btn-dark:hover { color: #fff; border-color: var(--accent); }

/* ── Manifesto ── */
#about { padding: 22vh 0; }
.manifesto {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.2vw, 3.1rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  max-width: 1080px;
  color: var(--ink);
}
.manifesto .w { opacity: 0.14; display: inline; }
.definition {
  margin-top: 64px;
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  color: var(--muted);
  letter-spacing: 0.01em;
  max-width: 720px;
}
.definition em { font-style: normal; color: var(--accent); }

/* ── Services ── */
#services { padding: 14vh 0 18vh; }
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 420px 60px;
  align-items: center;
  gap: 32px;
  padding: 44px 0;
  border-top: 1px solid var(--hairline);
  position: relative;
}
.service-row:last-of-type { border-bottom: 1px solid var(--hairline); }
.service-num {
  font-family: var(--font-cond);
  font-weight: 600; font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.3s ease;
}
.service-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.8vw, 2.7rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--ink);
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1), color 0.3s ease;
}
.service-desc {
  font-size: 13.5px; line-height: 1.7;
  color: var(--muted);
  transition: color 0.3s ease;
}
.service-arrow {
  justify-self: end;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  color: var(--muted);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.35s ease;
}
.service-row:hover .service-title { transform: translateX(16px); color: var(--accent); }
.service-row:hover .service-num { color: var(--accent); }
.service-row:hover .service-arrow {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: rotate(-45deg);
}
.services-note {
  margin-top: 56px;
  display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap;
}
.services-note p { font-size: 13.5px; color: var(--muted); max-width: 480px; line-height: 1.7; }

/* ── Process (dark, horizontal) ── */
#process { background: var(--dark); color: var(--dark-ink); overflow: hidden; }
#process .sect-head {
  padding: 12vh 72px 8vh 140px;
}
#process h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 4.5vw, 4.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.proc-viewport { position: relative; }
.proc-track {
  display: flex;
  gap: 2px;
  padding: 0 140px 14vh;
  width: max-content;
  align-items: stretch;
}
.proc-card {
  width: min(420px, 34vw);
  min-height: 380px;
  background: #1a1a1a;
  padding: 40px 36px 48px;
  display: flex; flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.proc-card .proc-num {
  font-family: var(--font-cond);
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: auto;
}
.proc-card h3 {
  font-family: var(--font-display);
  font-weight: 700; font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  text-transform: lowercase;
}
.proc-card p { font-size: 13.5px; line-height: 1.75; color: var(--dark-muted); }
.proc-card.proc-accent { background: var(--accent); }
.proc-card.proc-accent .proc-num { color: rgba(255,255,255,0.6); }
.proc-card.proc-accent p { color: rgba(255,255,255,0.75); }
.proc-progress {
  position: absolute; bottom: 8vh; left: 140px; right: 72px;
  height: 1px; background: rgba(255,255,255,0.12);
}
.proc-progress .bar {
  height: 100%; width: 0%;
  background: var(--accent);
}

/* ── Work ── */
#work { padding: 16vh 0 18vh; }
.work-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 40px; margin-bottom: 64px; flex-wrap: wrap;
}
.work-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 4.5vw, 4.4rem);
  letter-spacing: -0.02em; line-height: 1.05;
}
.work-head p { font-size: 13px; color: var(--muted); max-width: 300px; text-align: right; line-height: 1.7; }
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.work-card { position: relative; }
.work-visual {
  height: 300px;
  overflow: hidden;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.work-visual .visual-bg {
  position: absolute; inset: -10%;
  display: flex; align-items: center; justify-content: center;
  will-change: transform;
}
.work-card img { max-height: 96px; max-width: 200px; object-fit: contain; }
.work-meta { padding: 22px 2px 0; }
.work-meta h3 {
  font-family: var(--font-display);
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em;
  text-transform: lowercase;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
}
.work-meta h3 .work-url {
  font-family: var(--font-cond);
  font-weight: 600; font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent);
  white-space: nowrap;
}
.work-meta p { margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.work-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.work-tags span {
  font-size: 10.5px; letter-spacing: 0.05em;
  color: #555;
  background: rgba(0,0,0,0.07);
  padding: 3px 9px;
}

/* ── Contact ── */
#contact { padding: 18vh 0 12vh; }
.contact-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4rem, 11vw, 10.5rem);
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-transform: lowercase;
}
.contact-title .line { overflow: hidden; display: block; }
.contact-title .line > span { display: block; }
.contact-row {
  margin-top: 64px;
  display: flex; align-items: center; gap: 36px; flex-wrap: wrap;
}
.contact-mail {
  font-family: var(--font-cond);
  font-size: 13px; letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.25s ease;
}
.contact-mail:hover { color: var(--ink); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--hairline);
  margin-top: 10vh;
}
footer .section-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; padding-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
footer span, footer a {
  font-size: 12px; color: var(--muted); letter-spacing: 0.04em;
}
footer a:hover { color: var(--ink); }

/* ── Reveal helpers ── */
.rv { opacity: 0; transform: translateY(36px); }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
  .hero-sub, .hero-scroll { opacity: 1; }
  .manifesto .w { opacity: 1; }
  #loader { display: none; }
}

/* ── Tweaks panel (vanilla) ── */
.twx-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 210;
  width: 250px;
  background: rgba(250,249,247,0.85);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 0.5px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11.5px; color: #29261b;
  padding: 12px 14px 14px;
  display: none;
}
.twx-panel.open { display: block; }
.twx-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.twx-hd b { font-size: 12px; }
.twx-x { border: 0; background: none; font-size: 13px; color: rgba(41,38,27,0.55); cursor: pointer; }
.twx-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.twx-row label { color: rgba(41,38,27,0.72); font-weight: 500; }
.twx-row input[type=range] { flex: 1; accent-color: #4C7695; }
.twx-swatches { display: flex; gap: 6px; }
.twx-swatches button {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid transparent; cursor: pointer;
}
.twx-swatches button.sel { border-color: #29261b; }
.twx-toggle { width: 32px; height: 18px; border: 0; border-radius: 999px; background: rgba(0,0,0,0.15); position: relative; cursor: pointer; padding: 0; }
.twx-toggle[data-on="1"] { background: #34c759; }
.twx-toggle i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.twx-toggle[data-on="1"] i { transform: translateX(14px); }

/* ── Responsive easing for smaller desktop ── */
@media (max-width: 1100px) {
  .section-inner { padding-left: 110px; padding-right: 40px; }
  #process .sect-head { padding-left: 110px; padding-right: 40px; }
  .proc-track { padding-left: 110px; }
  .hero-scroll { left: 110px; }
  .proc-progress { left: 110px; right: 40px; }
  .service-row { grid-template-columns: 60px 1fr 60px; }
  .service-desc { display: none; }
  .work-grid { grid-template-columns: 1fr 1fr; }
}
