/* ============ TOKENS — stationery on a desk ============ */
:root {
  --paper: #f5f3ec;
  --card: #ffffff;
  --ink: #181a2e; /* dark navy ink */
  --muted: #5b5e76;
  --pen: #2742e8; /* ballpoint blue */
  --red: #e8402a; /* red correction pen */
  --hi: #ffd43b; /* highlighter */
  --line: rgba(24, 26, 46, 0.16);
  --disp: "Anton", sans-serif;
  --body: "Hanken Grotesk", sans-serif;
  --hand: "Caveat", cursive;
  --mono: "JetBrains Mono", monospace;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --w: 1100px;
}

html,
body {
  overflow-x: hidden;
}

.marquee {
  transform: rotate(-1.3deg); /* remove scale(1.02) */
}

.cv-btn {
  position: relative;
}
.cv-tag {
  position: absolute;
  top: -11px;
  right: -8px;
  font-family: var(--hand);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 1px 8px;
  transform: rotate(4deg);
  pointer-events: none;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* dotted notebook grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(
    rgba(24, 26, 46, 0.13) 1.1px,
    transparent 1.1px
  );
  background-size: 26px 26px;
}
::selection {
  background: var(--hi);
  color: var(--ink);
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid var(--pen);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ pen line down the margin (scroll-drawn) ============ */
#pen-rail {
  position: fixed;
  left: 30px;
  top: 0;
  height: 100vh;
  width: 30px;
  z-index: 5;
  pointer-events: none;
}
#pen-rail svg {
  height: 100%;
  width: 100%;
}
#pen-path {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.85;
}
@media (max-width: 1180px) {
  #pen-rail {
    display: none;
  }
}

/* ============ NAV ============ */
nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
}
nav .logo {
  font-family: var(--hand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pen);
  padding: 0 12px 0 8px;
  transform: rotate(-2deg);
}
nav a.link {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 9px;
  transition:
    color 0.15s,
    background 0.15s;
}
nav a.link:hover {
  color: var(--ink);
  background: rgba(24, 26, 46, 0.06);
}
nav a.cta {
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
  background: var(--ink);
  padding: 8px 16px;
  border-radius: 9px;
  margin-left: 8px;
  transition:
    background 0.15s,
    transform 0.15s;
}
nav a.cta:hover {
  background: var(--pen);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  nav a.link {
    display: none;
  }
}

/* ============ LAYOUT ============ */
.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 28px;
}
section {
  padding: 110px 0;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pen);
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  font-weight: 700;
}
.eyebrow::before {
  content: "";
  width: 30px;
  height: 3px;
  background: var(--pen);
}
h2 {
  font-family: var(--disp);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}
.hand-note {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--red);
  display: inline-block;
  transform: rotate(-2deg);
  text-transform: none;
  letter-spacing: 0;
}

/* highlighter swipe */
.mark {
  background-image: linear-gradient(var(--hi), var(--hi));
  background-repeat: no-repeat;
  background-position: 0 62%;
  background-size: 0% 45%;
  transition: background-size 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s;
}
.mark.in {
  background-size: 100% 45%;
}

/* reveal */
.rv {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.rv.in {
  opacity: 1;
  transform: none;
}
.rv.d1 {
  transition-delay: 0.08s;
}
.rv.d2 {
  transition-delay: 0.16s;
}
.rv.d3 {
  transition-delay: 0.24s;
}

/* doodle draw-in (once, then still) */
.doodle path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw path {
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
}
.draw.in path {
  animation: draw 1s 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ============ HERO ============ */
#hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 110px;
  padding-bottom: 0;
}
.hero-hello {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 16px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
}
.hero-hello .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1fa84b;
}
h1 {
  font-family: var(--disp);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(3.4rem, 11vw, 8.2rem);
  line-height: 0.95;
  letter-spacing: 0.005em;
}
h1 .first {
  position: relative;
  display: inline-block;
}
h1 .first .underline {
  position: absolute;
  left: -1%;
  bottom: -10px;
  width: 102%;
  height: auto;
  overflow: visible;
}
h1 .last {
  color: var(--pen);
}
/* "aka " annotation */
.aka {
  position: relative;
  display: inline-block;
  margin-left: 18px;
  vertical-align: super;
  font-family: var(--hand);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--red);
  transform: rotate(-5deg);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}
.aka svg {
  position: absolute;
  left: -14%;
  top: -32%;
  width: 128%;
  height: 160%;
  overflow: visible;
}
.role-line {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--muted);
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45ch;
  align-items: baseline;
}
.flipper {
  display: inline-grid;
  height: 1.4em;
  overflow: hidden;
  vertical-align: bottom;
  color: var(--ink);
  font-weight: 800;
  border-bottom: 3px solid var(--red);
}
.flipper span {
  grid-area: 1/1;
  transform: translateY(115%);
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.3, 0.9, 0.3, 1),
    opacity 0.35s;
  white-space: nowrap;
}
.flipper span.show {
  transform: translateY(0);
  opacity: 1;
}
.flipper span.out {
  transform: translateY(-115%);
  opacity: 0;
}
.hero-sub {
  max-width: 540px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-sub b {
  color: var(--ink);
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 38px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--ink);
}
.btn-primary {
  background: var(--pen);
  color: #fff;
}
.btn-primary:hover {
  background: #1b33cc;
}
.btn-ghost {
  background: var(--card);
  color: var(--ink);
}
.scroll-hint {
  margin-top: 64px;
  font-family: var(--hand);
  font-size: 1.35rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: rotate(-1deg);
}

/* ============ MARQUEE — tape strip ============ */
.marquee {
  background: var(--ink);
  color: var(--paper);
  padding: 16px 0;
  overflow: hidden;
  white-space: nowrap;
  transform: rotate(-1.3deg) scale(1.02);
  margin-top: 64px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.marquee-track {
  display: inline-flex;
  animation: scroll 30s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee span {
  font-family: var(--disp);
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  padding: 0 24px;
  text-transform: uppercase;
}
.marquee .sep {
  color: var(--hi);
  padding: 0;
}
@keyframes scroll {
  to {
    transform: translateX(-50%);
  }
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 880px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}
.about-copy p {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 1.05rem;
}
.about-copy p b {
  color: var(--ink);
}
.u-pen {
  border-bottom: 2.5px solid var(--pen);
  font-weight: 700;
  color: var(--ink);
}
.u-red {
  border-bottom: 2.5px solid var(--red);
  font-weight: 700;
  color: var(--ink);
}
.fact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.fact-tags span {
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 16px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  cursor: default;
}
.fact-tags span:hover {
  transform: translate(1px, 1px) rotate(-1.5deg);
  box-shadow: 2px 2px 0 var(--ink);
}

.code-card {
  position: relative;
  background: var(--ink);
  color: #e8eaf6;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.8;
  box-shadow: 7px 7px 0 rgba(24, 26, 46, 0.22);
  transform: rotate(1.6deg);
  transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1);
  max-width: 100%;
  overflow: hidden;
}
.code-card:hover {
  transform: rotate(0deg);
}
.tape {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 120px;
  height: 30px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 212, 59, 0.85);
  border: 1px solid rgba(24, 26, 46, 0.18);
}
.code-head {
  display: flex;
  gap: 7px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.code-head i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.code-head i:nth-child(1) {
  background: #ff5f57;
}
.code-head i:nth-child(2) {
  background: #febc2e;
}
.code-head i:nth-child(3) {
  background: #28c840;
}
.code-head em {
  font-style: normal;
  color: #8a8fb3;
  font-size: 0.74rem;
  margin-left: auto;
}
.code-body {
  padding: 22px 24px;
  overflow-x: auto;
}
.tk-k {
  color: #9d8cff;
}
.tk-v {
  color: #6ec7ff;
}
.tk-s {
  color: #a8e6a1;
}
.tk-c {
  color: #6a7099;
}
.tk-p {
  color: #e8eaf6;
}

/* ============ BEYOND ============ */
.beyond-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 50px;
}
@media (max-width: 880px) {
  .beyond-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}
@media (max-width: 880px) {
  .about-grid > div:last-child {
    overflow: hidden;
    padding: 8px;
  }
}
.bcard {
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 34px 30px;
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  transition:
    transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1),
    box-shadow 0.3s;
}
.bcard:hover {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 8px 10px 0 var(--ink);
}
.bcard .icon {
  margin-bottom: 20px;
}
.bcard h3 {
  font-family: var(--disp);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.35rem;
  margin-bottom: 10px;
}
.bcard p {
  color: var(--muted);
  font-size: 0.96rem;
}
.bcard .tag {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: var(--hand);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c);
  transform: rotate(4deg);
}

/* ============ DOODLE WALL ============ */
.wall {
  margin-top: 50px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--ink);
  box-shadow: var(--shadow);
  padding: 26px;
  position: relative;
}
.wall-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.wall-head h3 {
  font-family: var(--disp);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--paper);
}
.wall-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  background: none;
}
.swatch:hover {
  transform: scale(1.12);
}
.swatch.on {
  transform: scale(1.18);
  outline: 3px solid rgba(243, 238, 223, 0.4);
  outline-offset: 2px;
}
.wall-clear {
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 9px;
  border: 2px solid var(--paper);
  background: transparent;
  color: var(--paper);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.wall-clear:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}
#wall-canvas {
  display: block;
  width: 100%;
  height: 520px;
  border-radius: 10px;
  border: 1.5px dashed rgba(243, 238, 223, 0.25);
  cursor: crosshair;
  touch-action: none;
  background-image: radial-gradient(
    rgba(243, 238, 223, 0.07) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}
.wall-hint {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%) rotate(-2deg);
  font-family: var(--hand);
  font-size: 1.5rem;
  color: rgba(243, 238, 223, 0.35);
  pointer-events: none;
  transition: opacity 0.4s;
  white-space: nowrap;
}
.wall.used .wall-hint {
  opacity: 0;
}

/* ============ CONTACT ============ */
#contact {
  padding-bottom: 90px;
}
.contact-box {
  text-align: center;
}
.contact-box h2 {
  font-size: clamp(2.8rem, 7vw, 5.6rem);
}
.contact-box h2 .circ {
  position: relative;
  display: inline-block;
  color: var(--pen);
}
.contact-box h2 .circ svg {
  position: absolute;
  width: 116%;
  height: 140%;
  left: -8%;
  top: -20%;
  overflow: visible;
}
.contact-box > p {
  color: var(--muted);
  max-width: 460px;
  margin: 20px auto 42px;
  font-size: 1.06rem;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.clink {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  padding: 15px 28px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
.clink svg {
  width: 19px;
  height: 19px;
}
.clink:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--bg-h, #fff);
}
.clink.em {
  --bg-h: #fff6d6;
}
.clink.li {
  --bg-h: #e4ecff;
}
.clink.ig {
  --bg-h: #ffe4ea;
}

footer {
  border-top: 2px solid var(--ink);
  padding: 32px 0;
  background: var(--card);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
footer p {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
footer .hand-note {
  font-size: 1.25rem;
  color: var(--pen);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  .rv {
    opacity: 1;
    transform: none;
  }
  .draw path {
    stroke-dashoffset: 0 !important;
  }
  .mark {
    background-size: 100% 45%;
  }
}
