/* Homeric Code — paper, ink & clay (Attic black-figure palette) */
:root {
  --paper: #efeae0;
  --paper-2: #e6dfd1;
  --ink: #141311;
  --ink-2: #3b3833;
  --mute: #6f6a60;
  --clay: #d4865c;
  --clay-deep: #b96c43;
  --line: rgba(20, 19, 17, .16);
  --serif: "Geologica", "Commissioner", system-ui, sans-serif;
  --sans: "Commissioner", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
::selection { background: var(--clay); color: var(--paper); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.mono { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 16px; }

/* ── Cursor ───────────────────────────── */
.cursor { display: none; }
.has-cursor, .has-cursor a, .has-cursor button, .has-cursor label { cursor: none; }
.has-cursor .cursor { display: block; position: fixed; inset: 0; z-index: 150; pointer-events: none; }
.cursor__ring, .cursor__dot { position: fixed; left: 0; top: 0; border-radius: 50%; will-change: transform; }
.cursor__ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid var(--ink);
  display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background-color .25s, border-color .25s, opacity .25s;
}
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--ink); }
.cursor__label { font: 500 1rem var(--mono); color: var(--paper); opacity: 0; transition: opacity .2s; }
.cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--clay); border-color: var(--clay); }
.cursor.is-hover .cursor__label { opacity: 1; }
.cursor.is-hover .cursor__dot { opacity: 0; }
.cursor.is-down .cursor__ring { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.cursor.on-dark .cursor__ring { border-color: var(--paper); }
.cursor.on-dark .cursor__dot { background: var(--paper); }
.cursor.is-hidden { opacity: 0; }

/* ── Bar ──────────────────────────────── */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad); background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .3s, transform .4s var(--ease);
}
.bar.is-scrolled { border-bottom-color: var(--line); }
.bar.is-away { transform: translateY(-100%); }
.bar__brand { display: flex; align-items: center; gap: 10px; font: 500 1.05rem var(--serif); letter-spacing: -.01em; }
.bar__mark { width: 22px; height: 30px; color: var(--ink); transition: transform .6s var(--ease); }
.bar__brand:hover .bar__mark { transform: rotate(-8deg); }
.bar__nav { display: flex; gap: clamp(16px, 3vw, 40px); }
.bar__nav a { display: flex; align-items: baseline; gap: 6px; font-size: .92rem; position: relative; padding: 4px 0; }
.bar__nav i { font: 400 .65rem var(--mono); font-style: normal; color: var(--clay); }
.bar__nav a span { background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 1px no-repeat; transition: background-size .4s var(--ease); }
.bar__nav a:hover span, .bar__nav a.is-active span { background-size: 100% 1px; }
.bar__tools { display: flex; align-items: center; gap: 6px; }
.tool {
  height: 34px; min-width: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 17px;
  background: none; display: grid; place-items: center; cursor: pointer; transition: border-color .2s, background .2s, color .2s;
}
.tool:hover { border-color: var(--ink); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.tool .wave { opacity: .25; transition: opacity .2s; }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tool[aria-pressed="true"] .wave { opacity: 1; }
.tool--lang { font: 500 .72rem var(--mono); letter-spacing: .06em; }
.tool--menu { display: none; }
.tool--menu span { display: block; width: 14px; height: 1.5px; background: currentColor; transition: transform .3s; }
.tool--menu span + span { margin-top: -10px; transform: translateY(5px); }
.tool--menu span:first-child { transform: translateY(-1px); }
.tool--menu[aria-expanded="true"] span:first-child { transform: translateY(2px) rotate(45deg); }
.tool--menu[aria-expanded="true"] span + span { transform: translateY(0) rotate(-45deg); }

/* ── Hero ─────────────────────────────── */
.hero {
  position: relative; min-height: 100svh; padding: 96px var(--pad) 40px;
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
}
.hero__strings { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.hero__meta, .hero__body, .hero__hint { position: relative; z-index: 1; pointer-events: none; }
.hero__meta { display: flex; justify-content: space-between; color: var(--mute); }
.hero__body { align-self: end; display: grid; grid-template-columns: 1fr minmax(260px, 380px); gap: 40px; align-items: end; }
.hero__body a { pointer-events: auto; }
.hero__title { grid-column: 1 / -1; font: 400 clamp(2.6rem, 9vw, 9rem)/.95 var(--serif); letter-spacing: -.045em; }
.hero__side { grid-column: 2; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero__title .line > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.hero__title .line:nth-child(2) > span { transition-delay: .08s; }
.hero__title .line:nth-child(3) > span { transition-delay: .16s; }
.is-ready .hero__title .line > span, .no-js .hero__title .line > span { transform: none; }
.line--ital { color: var(--clay); padding-left: .9em; font-weight: 300; }
.hero__lead { font-size: 1.08rem; color: var(--ink-2); margin-bottom: 24px; }
.hero__hint { margin: 28px 0 0; color: var(--mute); }

.pill {
  display: inline-flex; align-items: center; gap: 14px; padding: 14px 14px 14px 24px;
  border: 1px solid var(--ink); border-radius: 999px; background: transparent; cursor: pointer;
  font-weight: 500; transition: background .3s, color .3s;
}
.pill b { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 400; transition: transform .4s var(--ease); }
.pill:hover { background: var(--ink); color: var(--paper); }
.pill:hover b { background: var(--clay); transform: rotate(-45deg); }
.pill--solid { background: var(--ink); color: var(--paper); }
.pill--solid b { background: var(--clay); }
.pill--solid:hover { background: var(--clay-deep); border-color: var(--clay-deep); }
.pill--solid:hover b { background: var(--ink); }

/* ── Marquee ──────────────────────────── */
.marquee { border-block: 1px solid var(--ink); overflow: hidden; background: var(--ink); color: var(--paper); }
.marquee__track { display: flex; width: max-content; gap: 28px; padding: 16px 0; font: 300 clamp(1.4rem, 3vw, 2.2rem) var(--serif); letter-spacing: -.02em; will-change: transform; }
.marquee__track i { font-style: normal; color: var(--clay); }

/* ── Sections ─────────────────────────── */
.sec { padding: clamp(80px, 12vw, 160px) var(--pad); position: relative; }
.sec__label { display: flex; gap: 18px; color: var(--mute); margin-bottom: 28px; }
.sec__label span:first-child { color: var(--clay); }
.sec__title { font: 400 clamp(2rem, 5vw, 4.4rem)/1.02 var(--serif); letter-spacing: -.035em; max-width: 20ch; margin-bottom: clamp(48px, 7vw, 96px); }

/* Services — rhapsodies */
.rhaps { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--ink); }
.rhap {
  position: relative; display: grid; grid-template-columns: 72px minmax(0, 1.1fr) minmax(0, 1fr) 230px; gap: 24px; align-items: baseline;
  padding: 30px 0; border-top: 1px solid var(--ink); isolation: isolate; cursor: default;
}
.rhap::before {
  content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); z-index: -1; background: var(--clay);
  transform: scaleY(0); transform-origin: var(--origin, top); transition: transform .45s var(--ease);
}
.rhap:hover::before { transform: scaleY(1); }
.rhap__num { font: 400 1.4rem var(--serif); color: var(--clay); transition: color .3s; }
.rhap__title { font: 400 clamp(1.4rem, 2.8vw, 2.3rem)/1.08 var(--serif); letter-spacing: -.03em; transition: transform .45s var(--ease); }
.rhap__desc { margin: 0; color: var(--ink-2); max-width: 46ch; }
.rhap__tags { color: var(--mute); text-align: right; transition: color .3s; }
.rhap:hover .rhap__num, .rhap:hover .rhap__tags { color: var(--ink); }
.rhap:hover .rhap__title { transform: translateX(12px); }

/* Process — clay */
.sec--clay { background: var(--clay); color: var(--ink); }
.sec--clay .sec__label, .sec--clay .sec__label span:first-child { color: var(--ink); }
.route { position: relative; display: grid; grid-template-columns: 40px 1fr; max-width: 980px; margin-left: auto; }
.route__trace { position: relative; width: 2px; margin-left: 9px; background: rgba(20,19,17,.22); }
.route__trace span { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: var(--ink); }
.route__steps { list-style: none; margin: 0; padding: 0; }
.route__steps li { position: relative; padding: 0 0 clamp(48px, 7vw, 88px) 24px; display: grid; grid-template-columns: 56px 1fr; column-gap: 16px; }
.route__steps li:last-child { padding-bottom: 0; }
.route__steps .node {
  position: absolute; left: -38px; top: 10px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--clay); transition: background .3s, transform .4s var(--ease);
}
.route__steps .node::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .4s var(--ease); }
.route__steps li.on .node::after { transform: scale(1); }
.route__steps li.on .node { transform: scale(1.15); }
.route__steps .mono { padding-top: 14px; grid-row: span 2; }
.route__steps h3 { font: 400 clamp(1.6rem, 3.2vw, 2.6rem)/1.08 var(--serif); letter-spacing: -.03em; margin-bottom: 10px; }
.route__steps p { margin: 0; max-width: 52ch; }

/* Work — case */
.case { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.case__visual { display: block; perspective: 1200px; }
.browser {
  border: 1px solid var(--ink); border-radius: 10px; overflow: hidden; background: #f7f5f0;
  box-shadow: 14px 14px 0 var(--ink); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.case__visual:hover .browser { box-shadow: 20px 20px 0 var(--clay); }
.browser__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--ink); background: var(--paper-2); }
.browser__bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); }
.browser__bar span { margin-left: 12px; font: .7rem var(--mono); color: var(--mute); }
.browser__body { padding: 18px 22px 26px; background: linear-gradient(170deg, #e9efe2, #f7f5f0 60%); }
.b-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.b-nav b { width: 64px; height: 10px; background: #4f6b47; border-radius: 3px; margin-right: auto; }
.b-nav span { width: 34px; height: 6px; background: #c7cfbd; border-radius: 3px; }
.b-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: center; margin-bottom: 22px; }
.b-hero em { display: block; height: 14px; background: #2f3f2b; border-radius: 3px; margin-bottom: 8px; }
.b-hero em.s { width: 60%; }
.b-hero u { display: block; width: 90px; height: 24px; border-radius: 12px; background: var(--clay); margin-top: 16px; }
.b-hero figure { margin: 0; aspect-ratio: 1; border-radius: 50% 50% 8px 8px; background: radial-gradient(circle at 40% 35%, #b9cba9, #7f9a6f); }
.b-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.b-row b { height: 54px; border-radius: 6px; background: #fff; border: 1px solid #dcd8cc; }
.case__meta { color: var(--clay); }
.case__title { font: 400 clamp(2rem, 4vw, 3.2rem)/1.02 var(--serif); letter-spacing: -.035em; margin-bottom: 20px; }
.case__text > p:not(.mono) { color: var(--ink-2); }
.arrow-link { display: inline-block; margin-top: 8px; font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.arrow-link:hover { color: var(--clay); border-color: var(--clay); }

/* About — ink */
.sec--ink { background: var(--ink); color: var(--paper); }
.sec--ink .sec__label { color: rgba(239,234,224,.55); }
.about { display: grid; grid-template-columns: minmax(200px, .7fr) 1.3fr; gap: clamp(32px, 7vw, 120px); align-items: center; }
.about__markwrap { perspective: 800px; display: grid; place-items: center; }
.about__mark { width: min(100%, 300px); aspect-ratio: 580 / 780; color: var(--clay); transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); transition: transform .6s var(--ease); }
.about__big { font: 300 clamp(1.7rem, 3.4vw, 2.8rem)/1.12 var(--serif); letter-spacing: -.03em; margin-bottom: 1.2em; }
.about__text p:not(.about__big) { color: rgba(239,234,224,.72); max-width: 60ch; }

/* Contact */
.contact__title { font: 400 clamp(2.6rem, 8vw, 8rem)/.95 var(--serif); letter-spacing: -.045em; margin-bottom: clamp(48px, 7vw, 96px); }
.contact__title em { color: var(--clay); font-style: normal; font-weight: 300; }
.contact__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.contact__info p { color: var(--ink-2); max-width: 40ch; }
.mail { display: inline-block; font: 400 clamp(1.4rem, 2.8vw, 2.1rem) var(--serif); letter-spacing: -.02em; border-bottom: 1px solid var(--clay); overflow-wrap: anywhere; transition: color .2s; }
.mail:hover { color: var(--clay); }
.copy { display: block; margin-top: 14px; background: none; border: 0; padding: 0; color: var(--mute); cursor: pointer; }
.copy:hover { color: var(--ink); }

.form { display: grid; gap: 28px; }
.field { position: relative; display: block; }
.field input, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 22px 0 10px;
  font: 400 1.15rem var(--sans); color: var(--ink); border-radius: 0; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--clay); box-shadow: 0 1px 0 var(--clay); }
.field > span { position: absolute; left: 0; top: 22px; color: var(--mute); pointer-events: none; transition: transform .3s var(--ease), font-size .3s, color .3s; transform-origin: left; }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span { transform: translateY(-22px) scale(.78); color: var(--clay); }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { padding: 0; margin-bottom: 12px; color: var(--mute); font-size: .95rem; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; transition: all .2s; }
.chips label:hover span { border-color: var(--ink); }
.chips input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chips input:focus-visible + span { outline: 2px solid var(--clay); outline-offset: 2px; }
.form .pill { justify-self: start; }
.form__note { margin: 0; min-height: 1.2em; color: var(--mute); text-transform: none; }
.form__note.is-error { color: var(--clay-deep); }

/* Footer */
.foot { padding: clamp(64px, 10vw, 120px) var(--pad) 28px; border-top: 1px solid var(--ink); display: grid; justify-items: center; gap: 56px; }
.foot__logo { width: clamp(150px, 20vw, 220px); aspect-ratio: 758 / 912; color: var(--ink); }
.foot__row { width: 100%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--mute); }
.foot__row a:hover { color: var(--ink); }

/* Reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .rv { opacity: 1; transform: none; }
  .hero__title .line > span { transform: none; }
}

/* ── Responsive ───────────────────────── */
@media (max-width: 960px) {
  .rhap { grid-template-columns: 52px 1fr; row-gap: 10px; }
  .rhap__desc, .rhap__tags { grid-column: 2; text-align: left; }
  .case, .about, .contact__grid { grid-template-columns: 1fr; }
  .about__mark { width: 180px; }
  .about__markwrap { justify-items: start; }
}
@media (max-width: 760px) {
  .tool--menu { display: grid; }
  .bar__nav {
    position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--ink); padding: 8px var(--pad) 20px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .3s var(--ease);
  }
  .bar__nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .bar__nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font: 400 1.5rem var(--serif); letter-spacing: -.02em; gap: 12px; }
  .bar__brand span { font-size: 1.05rem; }
  .hero { padding-top: 84px; }
  .hero__body { grid-template-columns: 1fr; gap: 28px; }
  .hero__side { grid-column: 1; }
  .line--ital { padding-left: .4em; }
  .hero__meta > span:first-child { display: none; }
  .hero__meta { justify-content: flex-end; }
  .route { grid-template-columns: 28px 1fr; }
  .route__trace { margin-left: 8px; }
  .route__steps li { grid-template-columns: 1fr; padding-left: 14px; }
  .route__steps .node { left: -27px; }
  .route__steps .mono { padding-top: 0; margin-bottom: 6px; grid-row: auto; }
  .browser { box-shadow: 8px 8px 0 var(--ink); }
}
