/* LEVEL 8 — redesign. Ink on paper, one accent, one big idea: the project index. */

:root {
  --paper: #fafaf8;
  --ink: #0e0e0e;
  --mute: #77776f;
  --line: #d9d9d3;
  --accent: #f92672;
  --gutter: clamp(16px, 3vw, 40px);
  --font: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
}

.dark {
  --paper: #0e0e0e;
  --ink: #f2f2ee;
  --mute: #8d8d85;
  --line: #2b2b28;
}
.dark, .light { background: var(--paper); color: var(--ink); }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px;
  background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100;
}
.skip:focus { top: 12px; }

.wrap { padding-inline: var(--gutter); max-width: 1680px; margin-inline: auto; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.mark {
  font-weight: 500; font-size: 26px; letter-spacing: -0.04em;
  text-decoration: none;
}
.mark i { font-style: normal; color: var(--accent); }
.nav { display: flex; gap: clamp(16px, 3vw, 40px); font-size: 16px; }
.nav a { text-decoration: none; padding: 6px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .25s; }
.nav a:hover { background-size: 100% 1.5px; }

/* ---------- hero ---------- */
.hero {
  --step: clamp(0px, 5.2vw, 96px); /* each line climbs one level */
  min-height: calc(100svh - 64px);
  display: flex; flex-direction: column; justify-content: space-between;
  padding-block: clamp(40px, 9vh, 110px) clamp(32px, 6vh, 64px);
}
.hero h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(46px, 10.6vw, 200px);
  line-height: .88;
  letter-spacing: -0.045em;
}
.hero h1 .ln { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; padding-left: calc(var(--i) * var(--step)); }
.hero h1 .ln:nth-child(1) { --i: 0; }
.hero h1 .ln:nth-child(2) { --i: 1; }
.hero h1 .ln:nth-child(3) { --i: 2; }
.hero h1 .ln > span { display: block; transform: translateY(105%); animation: rise .9s cubic-bezier(.2,.8,.2,1) forwards; }
.hero h1 .ln:nth-child(2) > span { animation-delay: .1s; }
.hero h1 .ln:nth-child(3) > span { animation-delay: .2s; }
@keyframes rise { to { transform: none; } }

.hero-foot {
  position: relative;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
  margin-top: clamp(40px, 8vh, 96px); padding-top: 32px; align-items: end;
  border-top: 1px solid var(--line);
}
/* same skewed marker used on the step rails below */
.hero-foot::before {
  content: ""; position: absolute; left: 0; top: -9px; width: 34px; height: 16px;
  background: var(--accent); transform: skewX(-38deg); transform-origin: left bottom;
}
.hero-foot p { grid-column: 1 / span 6; margin: 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.3; letter-spacing: -0.01em; max-width: 34ch; }
.hero-foot .go { grid-column: 9 / span 4; justify-self: end; background: var(--accent); border-color: var(--accent); color: #0e0e0e; }
.hero-foot .go:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.hero-foot .go svg { transition: transform .25s; }
.hero-foot .go:hover svg { transform: translateY(3px); }

.go {
  display: inline-flex; align-items: center; gap: 14px;
  font-size: 18px; text-decoration: none; font-weight: 500;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 14px 26px;
  transition: background .2s, color .2s;
}
.go:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.go svg { width: 18px; height: 18px; }

/* ---------- section scaffold ---------- */
section { border-top: 1px solid var(--line); padding-block: clamp(56px, 10vh, 120px); }
.head {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
  margin-bottom: clamp(36px, 6vh, 72px);
}
.head h2 {
  grid-column: 1 / span 9; margin: 0;
  font-size: clamp(34px, 5.2vw, 84px); font-weight: 500; line-height: .98; letter-spacing: -0.04em;
}
.head .side { grid-column: 10 / span 3; color: var(--mute); font-size: 16px; align-self: end; margin: 0; }

/* ---------- method: real sequence, numbered ---------- */
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: s;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); align-items: start;
  --rise: clamp(48px, 7vw, 120px);
}
/* staircase: each step sits one level higher than the last */
.steps li {
  position: relative; counter-increment: s;
  border-top: 2px solid var(--accent); padding-top: 28px;
}
.steps li:nth-child(1) { margin-top: calc(var(--rise) * 2); }
.steps li:nth-child(2) { margin-top: var(--rise); }
/* diagonal marker on the rail */
.steps li::after {
  content: ""; position: absolute; left: 0; top: -9px; width: 34px; height: 16px;
  background: var(--accent); transform: skewX(-38deg); transform-origin: left bottom;
}
/* big step number */
.steps li::before {
  content: counter(s); display: block; margin-bottom: 40px; color: var(--ink);
  font-size: clamp(72px, 9vw, 150px); line-height: .8; letter-spacing: -0.06em; font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.steps h3 { margin: 0 0 12px; font-size: clamp(26px, 2.6vw, 40px); letter-spacing: -0.03em; line-height: 1; font-weight: 500; }
.steps h3::after {
  content: ""; display: block; width: 72px; height: 10px; margin-top: 18px;
  background: repeating-linear-gradient(115deg, var(--accent) 0 3px, transparent 3px 10px);
}
.steps p { margin: 18px 0 0; color: var(--mute); max-width: 36ch; }


/* ---------- project index (the memorable part) ---------- */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.row {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 2.4fr) 40px;
  gap: var(--gutter); align-items: center;
  padding-block: clamp(18px, 2.6vw, 34px);
  border-bottom: 1px solid var(--line);
  text-decoration: none; position: relative;
  transition: padding .35s cubic-bezier(.2,.8,.2,1), color .2s;
}
.row .name { font-size: clamp(28px, 4.6vw, 76px); font-weight: 500; letter-spacing: -0.045em; line-height: .95; }
.row .kind { color: var(--mute); font-size: 16px; }
.row .tech { font-size: 15px; color: var(--mute); }
.row .arr { width: 28px; height: 28px; justify-self: end; opacity: 0; transform: translate(-8px, 8px); transition: .25s; color: var(--accent); }
.row .thumb { display: none; }

@media (hover: hover) and (pointer: fine) {
  .index:hover .row { color: var(--mute); }
  .index .row:hover { color: var(--ink); padding-left: 18px; }
  .row:hover .arr, .row:focus-visible .arr { opacity: 1; transform: none; }
}

#peek {
  position: fixed; left: 0; top: 0; width: clamp(260px, 26vw, 460px); aspect-ratio: 16 / 10;
  pointer-events: none; z-index: 40; opacity: 0; transform: translate(-999px, -999px) scale(.94);
  transition: opacity .2s, scale .2s; background: var(--line);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.45);
}
#peek.on { opacity: 1; }
#peek img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* ---------- about ---------- */
/* code symbol </> as a quiet backdrop on the right */
#sobre { position: relative; overflow: hidden; }
#sobre::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  right: clamp(-40px, -1vw, 0px); top: clamp(24px, 6vh, 72px);
  width: clamp(280px, 44vw, 860px); aspect-ratio: 300 / 160;
  transform: rotate(-10deg); opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 160' fill='none' stroke='%23e6e6e1' stroke-width='14' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M95 30 25 80l70 50M205 30l70 50-70 50M170 15 130 145'/%3E%3C/svg%3E") center / contain no-repeat;
}
#sobre .wrap { position: relative; z-index: 1; }
.about { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter); }
.about .big {
  grid-column: 1 / span 10; margin: 0;
  font-size: clamp(30px, 4.6vw, 76px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 500;
  text-wrap: balance;
}
.about .cols {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gutter);
  margin-top: clamp(48px, 9vh, 112px);
}
.about .cols > div { position: relative; border-top: 2px solid var(--ink); padding-top: 28px; }
.about .cols > div:nth-child(1) { grid-column: 1 / span 5; }
.about .cols > div:nth-child(2) { grid-column: 7 / span 5; }
.about .cols > div::before {
  content: ""; position: absolute; left: 0; top: -9px; width: 34px; height: 16px;
  background: var(--accent); transform: skewX(-38deg); transform-origin: left bottom;
}
.about h3 { margin: 0 0 14px; font-size: clamp(24px, 2.4vw, 36px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.about .cols p { margin: 0; color: var(--mute); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.4; max-width: 30ch; }

/* ---------- contact ---------- */
.contact { border-top: 0; }
.contact { padding-block: clamp(72px, 14vh, 160px) clamp(48px, 8vh, 96px); }
.contact .lead { margin: 0 0 clamp(20px, 4vh, 40px); font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.02em; color: var(--mute); }
.contact .mail {
  display: inline-flex; align-items: flex-start; gap: .06em; max-width: 100%;
  font-weight: 500; text-decoration: none;
  font-size: clamp(28px, 7.4vw, 144px); letter-spacing: -0.045em; line-height: 1; overflow-wrap: anywhere;
  padding-bottom: .06em;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 .05em no-repeat;
  transition: color .2s, background-size .5s cubic-bezier(.2,.8,.2,1);
}
.contact .mail svg { flex: none; width: .5em; height: .5em; margin-top: .12em; color: var(--accent); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.contact .mail:hover, .contact .mail:focus-visible { background-size: 100% .05em; }
.contact .mail:hover svg, .contact .mail:focus-visible svg { transform: translate(.06em, -.06em); }

.contact .meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px;
  margin-top: clamp(40px, 8vh, 96px); padding-top: 28px; border-top: 1px solid var(--line);
}
.contact .tel { font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.02em; text-decoration: none; }
.contact .tel:hover { color: var(--accent); }
.contact .acts { display: flex; flex-wrap: wrap; gap: 12px; }
.go { font-family: inherit; color: var(--ink); background: transparent; cursor: pointer; }
.acts .go:hover, .acts .go:focus-visible { background: var(--accent); border-color: var(--accent); color: #0e0e0e; }
.go--fill { background: #fff; border-color: #fff; color: #0e0e0e; }
.go--fill:hover { background: var(--accent); border-color: var(--accent); color: #0e0e0e; }

footer { color: var(--mute); padding-block: 0 28px; font-size: 14px; }
footer .foot { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 20px; }

/* ---------- pink highlights ---------- */
em { font-style: normal; color: var(--accent); }
.statement { position: relative; padding-block: clamp(96px, 24vh, 280px); }
/* same skewed marker as the other rails */
.statement::before {
  content: ""; position: absolute; left: max(var(--gutter), calc((100% - 1680px) / 2 + var(--gutter))); top: -9px;
  width: 34px; height: 16px; background: var(--accent); transform: skewX(-38deg); transform-origin: left bottom;
}
/* reading hierarchy: light grey carries the sentence, graphite carries the meaning */
.statement { --chumbo: #26262b; --cinza: #97978f; }
.statement p {
  margin: 0; max-width: 18em; font-size: clamp(32px, 6vw, 104px); font-weight: 400;
  line-height: 1.1; letter-spacing: -0.035em; word-spacing: .04em; text-wrap: balance;
  color: var(--cinza);
}
.statement p em { color: var(--chumbo); font-weight: 500; }
.statement .smile { display: inline-block; width: .72em; height: .72em; vertical-align: .02em; color: var(--cinza); margin-inline: .04em; }
.statement .smile svg { display: block; width: 100%; height: 100%; }

/* reading reveal: words light up with scroll (class added by JS, so no-JS shows the final state) */
.statement.reveal p .w { color: #dcdcd6; transition: color .4s; }
.statement.reveal p .w.on { color: var(--cinza); }
.statement.reveal p em .w.on { color: var(--chumbo); }
.statement.reveal .smile rect { opacity: 0; transition: opacity .1s; transition-delay: 0s; }
.statement.reveal .smile.on rect { opacity: 1; transition-delay: calc(var(--k) * 32ms); }

/* ---------- back to top ---------- */
.totop {
  position: fixed; right: var(--gutter); bottom: var(--gutter); z-index: 60;
  width: 52px; height: 52px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent); color: #0e0e0e;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity .3s, transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s .3s, background .2s;
}
.totop.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.totop:hover { background: #26262b; color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 8px 24px -8px rgba(0,0,0,.5); }
.totop svg { width: 22px; height: 22px; transition: transform .25s; }
.totop:hover svg { transform: translateY(-3px); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-foot p, .hero-foot .go { grid-column: 1 / -1; justify-self: start; }
  .hero { --step: 0px; }
  .hero-foot { row-gap: 24px; }
  .head h2, .head .side { grid-column: 1 / -1; }
  .steps { grid-template-columns: 1fr; }
  .steps li:nth-child(n) { margin-top: 0; margin-bottom: 40px; }
  .steps li::before { margin-bottom: 20px; font-size: 72px; }
  .about .big, .about .cols { grid-column: 1 / -1; }
  .about .cols > div:nth-child(n) { grid-column: 1 / -1; }
  .row { grid-template-columns: 1fr 88px; grid-template-areas: "n t" "k t"; row-gap: 6px; }
  .row .name { grid-area: n; }
  .row .kind { grid-area: k; }
  .row .tech { display: none; }
  .row .arr { display: none; }
  .row .thumb { display: block; grid-area: t; width: 88px; aspect-ratio: 1; object-fit: cover; object-position: top; }
  .nav a:not(:last-child):not(:nth-last-child(2)) { display: none; }
  body { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 .ln > span { animation: none; transform: none; }
  .row, #peek, .totop, .totop svg { transition: none; }
}
