/* zidery.com
 *
 * 60-30-10 from the logo's three colours and nothing else:
 *   60  chocolate   the page
 *   30  cream       the tiles
 *   10  tan         the accent: buttons, the chart line, the "Got footage?" band
 * Measured on the home page at full height: 62 / 27 / 11.
 */

:root {
  --choc: #24160C;
  --choc-2: #34200F;
  --choc-3: #3A2414;
  --cream: #F3D5B5;
  --cream-hi: #FAEBDA;
  --tan: #D4A276;
  --tan-2: #A8764A;
  --tan-3: #8A5A33;
  --ink-dim: #6B4A2E;
  --on-choc-dim: rgba(243, 213, 181, .72);
  --shadow: rgba(0, 0, 0, .35);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 32px;
  --max: 1100px;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { overflow-x: clip; }
body {
  background: radial-gradient(120% 80% at 50% 0%, var(--choc-2), var(--choc) 70%) fixed;
  color: var(--cream);
  font-family: "Fredoka", ui-rounded, system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--cream); color: var(--choc); padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--tan); outline-offset: 3px; border-radius: 8px; }

/* ------------------------------------------------ texture and blobs */

body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .8 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.blob {
  position: fixed; z-index: 0; background: var(--choc-3); pointer-events: none;
  animation: morph 16s ease-in-out infinite alternate, drift 22s ease-in-out infinite alternate;
}
.blob--1 { width: 46vw; height: 46vw; top: -14vw; left: -16vw; }
.blob--2 { width: 34vw; height: 34vw; bottom: -12vw; right: -10vw; animation-delay: -6s, -9s; }

.nav, main, .site-foot { position: relative; z-index: 1; }

/* ------------------------------------------------------------ nav */

.nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand img { width: 44px; height: 44px; display: block; transition: transform .35s var(--spring); }
.brand:hover img { transform: rotate(-10deg) scale(1.1); }
.brand span { font-size: 26px; font-weight: 700; letter-spacing: .02em; line-height: 1; color: var(--cream); }
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: none; font-weight: 500; font-size: 16px; padding: 0 14px; border-radius: 999px;
  transition: background .25s;
}
.nav__links a:hover { background: rgba(243, 213, 181, .12); }
.nav__links a[aria-current="page"] { background: rgba(243, 213, 181, .14); }

/* ----------------------------------------------------------- layout */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
main { padding-top: clamp(16px, 3vw, 32px); }

.page-head { padding: clamp(24px, 5vw, 64px) 0 clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(48px, 7vw, 84px); font-weight: 700; line-height: .95; letter-spacing: -.02em; margin: 0; }
.page-head p { font-size: clamp(18px, 1.8vw, 22px); color: var(--on-choc-dim); margin: 14px 0 0; max-width: 40ch; line-height: 1.4; }

/* ------------------------------------------------------------ tiles */

.tile {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 24px;
  background: var(--cream); color: var(--choc); text-decoration: none;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 18px 40px var(--shadow);
  transition: transform .4s var(--spring);
  animation: tile-in .7s var(--spring) both;
}
a.tile:hover, .tile--lift:hover { transform: translateY(-6px) rotate(-.6deg); }
.tile h2 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.01em; }
.tile > p { margin: 6px 0 0; color: var(--ink-dim); font-size: 16px; }
.go { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: 15px; }
.go::after { content: " →"; display: inline-block; color: var(--tan-2); transition: transform .3s var(--spring); }
.tile:hover .go::after { transform: translateX(6px); }

/* the one filled block of accent: it marks the thing to do */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 28px;
  background: var(--tan); color: var(--choc); text-decoration: none;
  border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px) clamp(24px, 3.4vw, 40px);
  box-shadow: 0 8px 0 var(--tan-3), 0 24px 50px var(--shadow);
  transition: transform .35s var(--spring), box-shadow .35s;
  animation: tile-in .7s .3s var(--spring) both;
}
.cta:hover { transform: translateY(-4px) rotate(-.4deg); }
.cta:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--tan-3), 0 10px 24px var(--shadow); }
.cta strong { font-size: clamp(26px, 3vw, 40px); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.cta small { display: block; font-size: 17px; font-weight: 500; opacity: .85; margin-top: 4px; }
.cta .arrow { font-size: 40px; line-height: 1; transition: transform .35s var(--spring); }
.cta:hover .arrow { transform: translateX(8px) rotate(-12deg); }

.pill {
  display: inline-flex; align-items: center; min-height: 44px;
  background: var(--tan); color: var(--choc); text-decoration: none; border: 0; cursor: pointer;
  font: 700 17px "Fredoka", ui-rounded, sans-serif; padding: 0 22px; border-radius: 999px;
  box-shadow: 0 5px 0 var(--tan-3); transition: transform .2s var(--spring), box-shadow .2s;
}
.pill:hover { transform: translateY(-2px) rotate(-2deg); }
.pill:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--tan-3); }
.pill--quiet { background: transparent; box-shadow: inset 0 0 0 2px rgba(36, 22, 12, .22); font-weight: 600; }
.pill--quiet:active { box-shadow: inset 0 0 0 2px rgba(36, 22, 12, .22); }

/* ------------------------------------------------------ home grid */

.hub {
  display: grid; gap: 28px;
  grid-template-columns: 1.15fr 1fr 1fr;
  grid-template-areas: "edits trading trading" "edits building writing";
}
.hub .edits { grid-area: edits; animation-delay: .05s; }
.hub .trading { grid-area: trading; animation-delay: .12s; }
.hub .building { grid-area: building; animation-delay: .19s; }
.hub .writing { grid-area: writing; animation-delay: .26s; }

.screen { margin: 18px auto 0; width: min(300px, 100%); }
.screen video, .cut video {
  display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 26px; border: 5px solid var(--choc); background: var(--choc);
  box-shadow: 0 24px 50px var(--shadow);
}
.credit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.credit { font-size: 14px; color: var(--ink-dim); }
.credit b { color: var(--choc); font-weight: 600; display: block; font-size: 16px; }

.chart { flex: 1; width: 100%; min-height: 160px; margin-top: 14px; }
.chart .line { fill: none; stroke: var(--tan-2); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.4s .5s cubic-bezier(.65, 0, .35, 1) forwards; }
.chart .area { fill: url(#chart-fill); opacity: 0; animation: fade 1s 2.4s forwards; }
.chart circle { fill: var(--tan-2); opacity: 0; animation: fade .3s 2.8s forwards, pulse 1.6s 3s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.chart .grid-line { stroke: rgba(36, 22, 12, .14); stroke-width: 1; stroke-dasharray: 3 6; }

.code { margin-top: 16px; font: 500 13.5px/1.7 ui-monospace, "SF Mono", Menlo, monospace; }
.code .k { color: var(--tan-3); font-weight: 700; }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--tan); vertical-align: -2px; animation: blink 1s steps(1) infinite; }

.note {
  margin-top: 16px; background: var(--tan); color: var(--choc); border-radius: 16px; padding: 16px 18px;
  transform: rotate(-2deg); box-shadow: 0 12px 26px var(--shadow); font-weight: 500;
  transition: transform .4s var(--spring);
}
.tile:hover .note { transform: rotate(1.5deg) scale(1.03); }
.note small { display: block; opacity: .75; font-size: 13px; margin-top: 6px; }

/* ------------------------------------------------------ edits page */

/* heading beside the work on a wide screen, so one cut reads as chosen and
   not as a grid with pieces missing */
.split { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 28px 56px; align-items: start; }
.split .page-head { position: sticky; top: 24px; }
.cuts { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(260px, 340px)); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split .page-head { position: static; } .cuts { grid-template-columns: 1fr; } }
.cut { padding: 16px; }
.cut video { border-width: 4px; box-shadow: none; }
.cut .credit-row { margin-top: 14px; padding: 0 6px 4px; }

/* -------------------------------------------------- reading pages */

.prose { padding: clamp(24px, 4vw, 48px); max-width: 780px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 30px; font-weight: 600; margin: 36px 0 8px; letter-spacing: -.01em; }
.prose h3 { font-size: 22px; font-weight: 600; margin: 28px 0 6px; }
.prose p, .prose li { font-size: 18px; line-height: 1.6; color: #4A301B; }
.prose p { margin: 10px 0; }
.prose ul { margin: 10px 0; padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--tan-2); }
.prose code { font: 500 .88em ui-monospace, "SF Mono", Menlo, monospace; background: rgba(36, 22, 12, .08); padding: 2px 6px; border-radius: 6px; }
.prose a { color: var(--choc); text-decoration-color: var(--tan-2); text-underline-offset: 3px; }
.meta { font-size: 15px; color: var(--ink-dim); margin: 0 0 18px; }

.posts { display: grid; gap: 20px; max-width: 780px; }
.posts .tile h2 { font-size: 26px; }

.back { display: inline-block; margin-top: 24px; color: var(--cream); font-weight: 600; text-decoration: none; }
.back::before { content: "← "; color: var(--tan); }

/* ------------------------------------------------------- today list */

.today { max-width: 680px; }
.todo-form { display: flex; gap: 10px; }
.todo-form input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 20px; border-radius: 999px;
  border: 2px solid rgba(36, 22, 12, .14); background: var(--cream-hi); color: var(--choc);
  font: 500 17px "Fredoka", ui-rounded, sans-serif; transition: border-color .2s;
}
.todo-form input::placeholder { color: rgba(36, 22, 12, .4); }
.todo-form input:focus { outline: none; border-color: var(--tan); }
.todo-form .pill { min-height: 52px; }

.todo-list { list-style: none; margin: 18px 0 0; padding: 0; }
.todo {
  display: flex; align-items: center; gap: 8px;
  border-top: 1.5px dashed rgba(36, 22, 12, .14);
  animation: tile-in .35s var(--spring) both;
}
.todo:first-child { border-top: 0; }
.todo label { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 52px; cursor: pointer; font-size: 18px; }
.todo input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(36, 22, 12, .35);
  display: grid; place-items: center; transition: background .2s, border-color .2s, transform .3s var(--spring);
}
.todo input::after { content: ""; width: 7px; height: 12px; border: solid var(--choc); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform .3s var(--spring); }
.todo input:checked { background: var(--tan); border-color: var(--tan); transform: scale(1.1); }
.todo input:checked::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.todo.is-done span { text-decoration: line-through; text-decoration-color: var(--tan-2); color: var(--ink-dim); }
.todo__x {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  font: 500 24px/1 "Fredoka", sans-serif; color: var(--ink-dim); transition: background .2s, opacity .2s;
}
.todo__x:hover { background: rgba(36, 22, 12, .08); color: var(--choc); }
/* the remove button only shows up where it's needed on a pointer device;
   touch has no hover, so it stays */
@media (hover: hover) {
  .todo__x { opacity: 0; }
  .todo:hover .todo__x, .todo__x:focus-visible { opacity: 1; }
}

.todo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 22px; }
.textbtn {
  min-height: 44px; border: 0; background: none; cursor: pointer; padding: 0 4px;
  font: 600 15px "Fredoka", sans-serif; color: var(--ink-dim); text-decoration: underline; text-underline-offset: 3px;
}
.textbtn:hover { color: var(--choc); }
.todo-status { min-height: 1.4em; margin: 12px 0 0; font-size: 15px; color: var(--ink-dim); }
.today .note { transform: rotate(-1.5deg); }

/* ----------------------------------------------------------- footer */

.site-foot {
  max-width: var(--max); margin: 0 auto; padding: 96px var(--gutter) 36px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 15px; color: var(--on-choc-dim);
}
.site-foot a { color: var(--cream); }
/* inline links a thumb has to hit get a real 44px target */
a.go, .site-foot a { display: inline-flex; align-items: center; min-height: 44px; }
a.go { align-self: flex-start; text-decoration: none; }

.spark { position: fixed; pointer-events: none; z-index: 5; width: 22px; fill: var(--tan); animation: pop .7s ease-out forwards; }

/* ------------------------------------------------------------ motion */

@keyframes morph {
  0%   { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
  50%  { border-radius: 70% 30% 46% 54% / 30% 62% 38% 70%; }
  100% { border-radius: 36% 64% 38% 62% / 62% 38% 62% 38%; }
}
@keyframes drift { to { transform: translate(4vw, 3vw) rotate(25deg); } }
@keyframes tile-in { from { transform: translateY(40px) scale(.96); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.6); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.4) rotate(0); opacity: 1; } to { transform: translate(-50%, -160%) scale(1.3) rotate(90deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .chart .line { stroke-dashoffset: 0; }
  .chart .area, .chart circle { opacity: 1; }
}

/* ------------------------------------------------------------ smaller */

@media (max-width: 900px) {
  .hub { grid-template-columns: 1fr 1fr; grid-template-areas: "edits edits" "trading trading" "building writing"; }
}
@media (max-width: 600px) {
  .hub { grid-template-columns: 1fr; grid-template-areas: "edits" "trading" "building" "writing"; }
  .brand img { width: 38px; height: 38px; }
  .brand span { font-size: 22px; }
  .nav__links a { padding: 0 10px; font-size: 15px; }
}
@media (max-width: 380px) {
  .nav { padding-inline: 12px; }
  .brand { gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .brand span { font-size: 19px; }
  .nav__links { gap: 0; }
  .nav__links a { padding: 0 7px; font-size: 14px; }
}
