:root {
  --bg: #f2f1ec;
  --bg-soft: #f8f7f3;
  --ink: #16150f;
  --ink-12: rgba(22, 21, 15, .12);
  --yellow: #fdcb58;
  --line: 1.5px solid var(--ink);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; }
a:hover { background: var(--yellow); }
::selection { background: var(--yellow); color: var(--ink); }
[hidden] { display: none !important; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes glyphOut {
  0%   { opacity: .9; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0;  transform: translate3d(0, -26px, 0) scale(.7); }
}

/* Cursor, trail, link preview — pointer devices only */
@media (hover: hover) and (pointer: fine) {
  body, a, button, textarea, input { cursor: none; }
}
@media (hover: none), (pointer: coarse) {
  #cursor-blob, #cursor-trail, #site-preview { display: none; }
}

#site-preview {
  position: fixed; top: 0; left: 0; z-index: 9;
  width: 260px; height: 171px; margin: -86px 0 0 26px;
  border: var(--line); background: var(--bg) center / cover no-repeat;
  box-shadow: 6px 6px 0 var(--ink-12);
  opacity: 0; transform: translate3d(-999px, -999px, 0) scale(.94);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
#cursor-trail { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
#cursor-trail span {
  position: absolute;
  font-family: var(--mono); color: var(--ink); background: var(--yellow);
  padding: 0 1px; animation: glyphOut .7s linear forwards;
}
#cursor-blob {
  position: fixed; top: 0; left: 0; z-index: 10;
  pointer-events: none; will-change: transform;
  opacity: 0; transition: opacity .2s ease;
}
#cursor-bar {
  display: block; width: 11px; height: 26px; margin: -13px 0 0 -2px;
  background: var(--yellow); box-shadow: 0 0 0 1.5px var(--ink);
  animation: blink 1.1s steps(1) infinite;
  transition: width .18s ease, height .18s ease, margin .18s ease, opacity .18s ease, border-radius .18s ease;
}
#cursor-blob.is-wide #cursor-bar {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; animation: none; background: rgba(253, 203, 88, .5);
}
#cursor-blob.is-down #cursor-bar { transform: scaleY(.6); }

/* Scroll-progress avatar */
#avatar {
  display: block; position: fixed; z-index: 5;
  right: clamp(14px, 2.2vw, 32px); bottom: clamp(14px, 2.2vw, 32px);
  width: clamp(64px, 6.4vw, 96px); height: clamp(64px, 6.4vw, 96px);
  border-radius: 50%; padding: 4px;
  background: conic-gradient(var(--ink) 0deg, var(--ink-12) 0deg);
}
#avatar:hover { filter: brightness(1.04); }
#avatar-inner {
  width: 100%; height: 100%; border-radius: 50%; border: var(--line);
  background: var(--yellow) url("../assets/avatar.png") center 46% / 118% no-repeat;
  will-change: transform; pointer-events: none;
}

/* Layout */
.wrap { position: relative; max-width: 1560px; margin: 0 auto; padding: 0 clamp(18px, 3.5vw, 56px); }

.label {
  flex: 0 0 14ch; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .5;
}
.col { flex: 1 1 340px; min-width: 0; }
.row, .block {
  display: flex; flex-wrap: wrap; gap: clamp(16px, 3vw, 48px); align-items: flex-start;
}
.block { padding: clamp(44px, 6vw, 96px) 0; border-bottom: var(--line); }

.btn {
  display: inline-block; border: var(--line); padding: 9px 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  background: transparent; color: var(--ink);
}
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--yellow); color: var(--ink); }
button.btn { padding: 11px 18px; cursor: pointer; }

.dot {
  display: inline-block; width: 7px; height: 7px;
  background: var(--yellow); border: var(--line); animation: blink 2.4s infinite;
}
.dot-round { width: 8px; height: 8px; border-radius: 50%; }
.soft { opacity: .7; }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px 24px; padding: 22px 0; border-bottom: var(--line);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.brand { font-weight: 700; }
.site-nav { display: flex; gap: clamp(11px, 1.7vw, 34px); white-space: nowrap; }
.nav-cta { border: var(--line); background: var(--yellow); padding: 6px 12px; margin: -6px 0; }
.nav-cta:hover { background: var(--ink); color: var(--bg); }

/* Hero */
.hero {
  display: grid; gap: clamp(28px, 4vw, 56px);
  padding: clamp(56px, 9vw, 140px) 0 clamp(48px, 7vw, 110px);
  border-bottom: var(--line);
}
.hero-label { padding-top: clamp(8px, 1.4vw, 20px); }
.status-label { padding-top: 6px; }
.hero-title-col { container-type: inline-size; }
.hero-title {
  margin: 0; position: relative; isolation: isolate;
  font-size: clamp(30px, 8.2cqw, 132px); line-height: .92; font-weight: 500; letter-spacing: -.035em;
}
.mark {
  background: var(--yellow); padding: 0 .08em; margin: 0 -.08em;
  white-space: nowrap; position: relative; z-index: -1;
}
.hero-status { display: grid; gap: 28px; max-width: 62ch; }
.lead { margin: 0; font-size: clamp(15px, 1.35vw, 20px); line-height: 1.65; }
.stack {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
  margin-top: -14px; opacity: .75; max-width: 46ch;
}
.stack span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .04em; }
.stack img { display: block; width: 14px; height: 14px; opacity: .85; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; border: var(--line); padding: 9px 14px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
}

/* Work */
.work-list { display: grid; }
.work-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end;
  padding: clamp(20px, 2.6vw, 34px) 0; border-top: var(--line);
}
.work-row > div:first-child { display: grid; gap: 10px; }
.work-row.is-muted { opacity: .55; }
.work-title { font-size: clamp(30px, 4.6vw, 68px); line-height: 1; letter-spacing: -.03em; }
.work-desc { font-size: 13px; opacity: .6; }
.work-meta { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; padding-bottom: 6px; }
.work-end { border-top: var(--line); }

/* Collaborations */
.clients-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  border-top: var(--line); border-left: var(--line);
}
.client {
  display: grid; gap: 34px; align-content: space-between; min-height: 178px; padding: 18px;
  background: var(--bg); border-right: var(--line); border-bottom: var(--line);
}
.client-kind { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .5; text-wrap: balance; }
.client-name { font-size: clamp(16px, 1.35vw, 22px); line-height: 1.15; letter-spacing: -.02em; }

/* Contact */
.contact { padding: clamp(56px, 8vw, 110px) 0 clamp(40px, 5vw, 70px); border-bottom: 0; }
.contact-col { position: relative; display: grid; gap: 14px; justify-items: start; }

.chat { border: var(--line); background: var(--bg-soft); max-width: 720px; width: 100%; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: var(--line);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.chat-step { margin-left: auto; opacity: .45; }
.chat-body { display: grid; gap: 14px; padding: clamp(16px, 2.2vw, 26px); }
.msg { display: grid; gap: 6px; justify-items: start; }
.msg-you { justify-items: end; }
.who { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .45; }
.bubble { border: var(--line); padding: 14px 16px; line-height: 1.45; max-width: 46ch; }
.bubble-first {
  background: var(--yellow); padding: 16px 18px; max-width: 42ch;
  font-size: clamp(17px, 1.9vw, 24px); line-height: 1.4; letter-spacing: -.01em;
  box-shadow: 5px 5px 0 var(--ink);
}
.bubble-yellow { background: var(--yellow); font-size: clamp(15px, 1.5vw, 20px); }
.bubble-plain { background: var(--bg); font-size: clamp(15px, 1.5vw, 20px); }
.msg-you .bubble { font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.chat-foot { display: grid; gap: 10px; padding: clamp(14px, 2vw, 22px); border-top: var(--line); margin: 0; }
.chat textarea, .chat input {
  width: 100%; border: var(--line); background: var(--bg); color: var(--ink);
  font-family: var(--mono); font-size: 15px; line-height: 1.5; padding: 12px 14px; outline: none;
}
.chat textarea { resize: vertical; }
.chat textarea:focus, .chat input:focus { box-shadow: 0 0 0 3px var(--yellow); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hint { font-size: 11px; opacity: .45; letter-spacing: .04em; }
.hint-error { opacity: .55; }
.chat-direct {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.chat-direct .soft { opacity: .5; }

.toast {
  position: absolute; margin-top: 6px; display: inline-flex; align-items: center; gap: 9px;
  border: var(--line); background: var(--yellow); padding: 9px 14px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast .sq { width: 7px; height: 7px; background: var(--ink); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding: 18px 0 32px; border-top: var(--line);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .55;
}

@media (prefers-reduced-motion: reduce) {
  .dot, #cursor-bar { animation: none; }
}
