/* Knotwork — modern, animated portfolio
   Lilac ground, ink type, one tangerine for actions; the four loop
   colours only ever appear inside the animations. */
:root {
  --brand: #FF6B2C;
  --brand-deep: #D9500F;
  --brand-soft: #FFE4D6;
  --brand-ink: #1B1234;

  --bg: #EFEAFB;
  --ink: #1B1234;
  --muted: #5E5578;
  --line: #D8CFF0;
  --card: #FFFFFF;
  --sky: #3D9BFF;
  --mint: #1FC79A;
  --sun: #FFC53D;
  --berry: #E4509A;

  --display: 'Dela Gothic One', 'Arial Black', sans-serif;
  --body: 'Albert Sans', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --wrap: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--body); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); }

/* ---------- header ---------- */
.header { padding: 20px 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; text-decoration: none; letter-spacing: -.01em; }
.logo-mark { width: 40px; height: 24px; fill: none; stroke-width: 3.5; }
.logo-mark circle:first-child { stroke: var(--brand); }
.logo-mark circle:last-child { stroke: var(--ink); animation: knot 4s ease-in-out infinite; transform-origin: 20px 12px; }
@keyframes knot { 50% { transform: translateX(-6px); } }
.nav { display: flex; gap: 32px; font-weight: 600; }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--brand-deep); }

.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 12px 22px; font-weight: 700; text-decoration: none; border: 2px solid var(--ink); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s; }
.btn-brand { background: var(--brand); color: var(--brand-ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-brand:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.btn-big { font-size: clamp(1rem, 2.4vw, 1.4rem); padding: 18px 32px; }

/* ---------- hero ---------- */
.hero { padding: 48px 0 80px; }
.hero-kicker { font-family: var(--mono); font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.headline { font-family: var(--display); font-weight: 400; font-size: clamp(2.8rem, 8.2vw, 7.6rem); line-height: .98; letter-spacing: -.02em; max-width: 13ch; }
.headline .w { display: inline-block; white-space: nowrap; }
.headline .ch { display: inline-block; transform: translateY(-110%); opacity: 0; animation: drop .8s cubic-bezier(.3, 1.55, .5, 1) forwards; animation-delay: calc(var(--i) * 32ms + 150ms); }
.headline .ch.hl { color: var(--brand); }
@keyframes drop { to { transform: none; opacity: 1; } }

.timeline { margin: 44px 0 30px; max-width: 760px; }
.tl-track { position: relative; height: 34px; border-radius: 10px; background: var(--card); border: 2px solid var(--ink); }
.tl-key { position: absolute; top: 50%; left: calc(var(--at) * .94 + 3%); width: 12px; height: 12px; background: var(--card); border: 2px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); transition: background .15s; }
.tl-key.hit { background: var(--brand); }
.tl-head { position: absolute; top: -8px; bottom: -8px; left: 3%; width: 2px; background: var(--brand-deep); }
.tl-head::before { content: ""; position: absolute; top: -6px; left: -6px; border: 7px solid transparent; border-top-color: var(--brand-deep); }
.timecode { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin-top: 10px; }
.timecode span { color: var(--ink); font-weight: 500; }
.hero-copy { font-size: 1.15rem; max-width: 52ch; color: var(--muted); }

/* ---------- principle tiles ---------- */
.principles { padding: 88px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 40px; }
.principles h2, .work h2, .process h2, .book h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.02; letter-spacing: -.01em; }
.section-head p { max-width: 42ch; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tile { background: var(--card); border: 2px solid var(--ink); border-radius: 24px; padding: 14px 14px 22px; }
.tile h3 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 16px 8px 6px; }
.tile p { margin: 0 8px; color: var(--muted); font-size: .95rem; }
.tile .used { margin-top: 12px; font-family: var(--mono); font-size: .74rem; color: var(--ink); }
.stage { position: relative; height: 210px; border-radius: 14px; background: var(--bg); overflow: hidden; }
.floor { position: absolute; left: 12%; right: 12%; bottom: 26px; height: 3px; border-radius: 2px; background: var(--ink); }

/* 1 · squash and stretch */
.stage-bounce .ball { position: absolute; left: calc(50% - 24px); bottom: 29px; width: 48px; height: 48px; border-radius: 50%; background: var(--brand); transform-origin: 50% 100%; animation: bounce 1.1s infinite; }
@keyframes bounce {
  0%   { transform: translateY(-120px) scale(.92, 1.08); animation-timing-function: cubic-bezier(.5, 0, .9, .5); }
  46%  { transform: translateY(0) scale(.9, 1.12); animation-timing-function: linear; }
  50%  { transform: translateY(0) scale(1.35, .65); animation-timing-function: linear; }
  56%  { transform: translateY(-6px) scale(.9, 1.1); animation-timing-function: cubic-bezier(.1, .5, .5, 1); }
  100% { transform: translateY(-120px) scale(.92, 1.08); }
}

/* 2 · anticipation */
.stage-antic .block { position: absolute; top: calc(50% - 26px); left: 12%; width: 52px; height: 52px; border-radius: 10px; background: var(--sky); animation: antic 2.4s infinite; transform-origin: 0 50%; }
@keyframes antic {
  0%, 12% { left: 12%; transform: scaleX(1); }
  32% { left: 7%; transform: scale(.78, 1.12); animation-timing-function: cubic-bezier(.7, 0, .9, .4); }
  46% { left: 72%; transform: scale(1.3, .86); animation-timing-function: ease-out; }
  56%, 84% { left: 70%; transform: scale(1); }
  100% { left: 12%; transform: scale(1); }
}

/* 3 · follow-through */
.stage-follow .cart { position: absolute; bottom: 29px; left: 10%; width: 70px; height: 34px; border-radius: 8px; background: var(--mint); animation: roll 2.6s infinite; }
.stage-follow .flag { position: absolute; left: 50%; bottom: 100%; width: 4px; height: 58px; background: var(--ink); transform-origin: 50% 100%; animation: sway 2.6s infinite; }
.stage-follow .flag::after { content: ""; position: absolute; top: 0; left: 4px; width: 30px; height: 20px; background: var(--brand); border-radius: 0 6px 6px 0; }
@keyframes roll {
  0% { left: 8%; animation-timing-function: cubic-bezier(.25, .1, .25, 1); }
  38%, 86% { left: calc(88% - 70px); }
  100% { left: 8%; }
}
@keyframes sway {
  0% { transform: rotate(0); } 10% { transform: rotate(-24deg); } 34% { transform: rotate(-18deg); }
  44% { transform: rotate(26deg); } 52% { transform: rotate(-13deg); } 60% { transform: rotate(7deg); }
  68% { transform: rotate(-3deg); } 76%, 86% { transform: rotate(0); } 92% { transform: rotate(14deg); } 100% { transform: rotate(0); }
}

/* 4 · arcs */
.stage-arc svg { position: absolute; left: 50%; top: 50%; width: 320px; height: 200px; transform: translate(-50%, -50%); fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 8; opacity: .45; }
.stage-arc .dot { position: absolute; left: calc(50% - 160px); top: calc(50% - 100px); width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--berry); offset-path: path('M30 170Q160 -30 290 170'); offset-rotate: 0deg; animation: arc 1.8s ease-in-out infinite alternate; }
@keyframes arc { from { offset-distance: 0%; } to { offset-distance: 100%; } }

/* 5 · slow in, slow out */
.stage-ease { display: grid; align-content: center; gap: 30px; padding: 0 12%; }
.lane { position: relative; height: 26px; border-bottom: 2px dashed rgba(27, 18, 52, .25); }
.lane em { position: absolute; right: 0; top: -20px; font-family: var(--mono); font-style: normal; font-size: .72rem; color: var(--muted); }
.lane .dot { position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; animation: slide 1.8s infinite alternate; }
.lane .linear { background: var(--ink); animation-timing-function: linear; }
.lane .eased { background: var(--sun); border: 2px solid var(--ink); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
@keyframes slide { to { left: calc(100% - 26px); } }

/* 6 · overlapping action */
.stage-overlap { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding-bottom: 28px; }
.stage-overlap span { width: 26px; height: 130px; border-radius: 13px; transform-origin: 50% 100%; animation: wave 1.6s ease-in-out infinite; }
.stage-overlap span:nth-child(1) { background: var(--brand); animation-delay: 0s; }
.stage-overlap span:nth-child(2) { background: var(--sun); animation-delay: .1s; }
.stage-overlap span:nth-child(3) { background: var(--mint); animation-delay: .2s; }
.stage-overlap span:nth-child(4) { background: var(--sky); animation-delay: .3s; }
.stage-overlap span:nth-child(5) { background: var(--berry); animation-delay: .4s; }
@keyframes wave { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- work list ---------- */
.work { padding: 88px 0; background: var(--card); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.work-list { margin-top: 32px; }
.work-list li { display: grid; grid-template-columns: 56px 1.6fr 1fr auto; align-items: center; gap: 22px; padding: 22px 0; border-top: 2px solid var(--ink); transition: padding .3s cubic-bezier(.3, 1.4, .5, 1); }
.work-list li:last-child { border-bottom: 2px solid var(--ink); }
.work-list li:hover { padding-left: 14px; }
.swatch { width: 56px; height: 40px; border-radius: 10px; background: var(--c); border: 2px solid var(--ink); }
.work-list h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.work-list p { color: var(--muted); }
.meta { color: var(--muted); }
.meta.mono { font-size: .85rem; color: var(--ink); }

/* ---------- process (bar widths = weeks) ---------- */
.process { padding: 88px 0; }
.process-sub { color: var(--muted); margin: 10px 0 30px; }
.bars { display: flex; gap: 8px; }
.bars li { flex: var(--w) 1 0; min-width: 0; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 16px 16px 18px; }
.bars li:nth-child(4) { background: var(--brand); }
.bars span { display: block; font-weight: 700; }
.bars em { font-family: var(--mono); font-style: normal; font-size: .76rem; color: var(--muted); }
.bars li:nth-child(4) em { color: var(--ink); }

/* ---------- book ---------- */
.book { padding: 96px 0 110px; }
.book-inner { display: grid; justify-items: start; gap: 26px; }
.book h2 { max-width: 16ch; font-size: clamp(2.4rem, 6vw, 5rem); }
.book p { color: var(--muted); max-width: 48ch; }
.footer { border-top: 2px solid var(--ink); padding: 22px 0 90px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-direction: column; align-items: flex-start; }
  .work-list li { grid-template-columns: 48px 1fr auto; }
  .work-list li .meta:not(.mono) { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .nav { display: none; }
  .header .btn { padding: 10px 16px; font-size: .88rem; }
  .tiles { grid-template-columns: 1fr; }
  .bars { flex-direction: column; }
  .bars li { flex: none; }
  .work-list li { grid-template-columns: 40px 1fr; }
  .work-list .meta.mono { grid-column: 2; }
  .swatch { width: 40px; height: 30px; }
  .principles, .work, .process, .book { padding: 64px 0; }
}
/* Reduced motion: every loop rests on its key pose instead of moving. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .headline .ch { transform: none; opacity: 1; }
  .stage-bounce .ball { transform: translateY(-60px); }
  .stage-arc .dot { offset-distance: 50%; }
  .stage-overlap span { transform: scaleY(.6); }
  html { scroll-behavior: auto; }
}
