/* Shared look for the project pages that open inside the portfolio's windows.
   Each page sets its accent with --c on <body>. */
@font-face {
  font-family: "Patrick Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/patrick-hand-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Patrick Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/patrick-hand-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #333;
  --ink-soft: #666;
  --ink-faint: #999;
  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "Patrick Hand", "Comic Neue", "Segoe Print", system-ui, sans-serif;
  font-size: 21px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(110, 110, 110, 0.22); color: inherit; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 28px 56px;
}

h1 {
  font-weight: normal;
  font-size: clamp(40px, 8vw, 60px);
  line-height: 1;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  color: var(--c, var(--ink));
  text-shadow: 0.8px 0 0 currentColor;
}
.tagline { font-size: 1.2em; margin: 0 0 28px; }

h2 {
  font-weight: normal;
  font-size: 30px;
  letter-spacing: 0.05em;
  line-height: 1.1;
  margin: 36px 0 12px;
}
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.3em; }
b, strong { font-weight: normal; text-shadow: 0.7px 0 0 currentColor, -0.2px 0 0 currentColor; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #bbb;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
a:hover { color: var(--c, #d23c3c); text-decoration-color: currentColor; }

img, video {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: var(--wobble);
  margin: 8px 0 20px;
}
figure { margin: 0 0 24px; }
figcaption { color: var(--ink-soft); font-size: 0.85em; margin-top: -12px; }

/* "built with" tags */
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags li {
  margin: 0;
  padding: 2px 14px 3px;
  border: 2px solid var(--ink-faint);
  border-radius: var(--wobble);
  font-size: 0.9em;
}

.btn {
  display: inline-block;
  font-size: 22px;
  color: #111;
  text-decoration: none;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: 4px 24px 6px;
  margin: 8px 12px 0 0;
  box-shadow: 2px 3px 0 0 rgba(0,0,0,0.12);
  transition: transform 0.15s ease-out, background 0.15s;
}
.btn:hover { color: #111; background: #f3f3f3; transform: rotate(-1deg) scale(1.03); }

/* only shown when the page is opened on its own, not inside a window */
.solo-only { display: none; }
.solo .solo-only { display: block; }
.back { font-size: 0.85em; color: var(--ink-soft); margin-bottom: 24px; }

/* ---------- left/right split (see split.js) ---------- */
.on-narrow { display: none; }

main.split-on {
  max-width: none;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 50%);
  height: 100vh;
  height: 100dvh;
}
main.split-on .text { overflow-y: auto; padding: 28px 36px 56px; }

.side {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 26px 18px 34px;
  overflow: hidden;
}
.side .divider {
  position: absolute;
  left: 0; top: 0;
  width: 12px; height: 100%;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.side .divider .t { stroke-width: 1.1; opacity: 0.45; }

/* the sketched frame around a video or a live site */
.stage { position: relative; flex: none; }
.stage .viewport {
  position: absolute;
  inset: 4px;
  overflow: hidden;
  background: #161616;
  border-radius: 3px;
}
.stage .frame {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}
.stage .frame .t { stroke-width: 1.3; opacity: 0.5; }
.side svg { overflow: visible; }

.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 0.9em;
  color: var(--ink-soft);
}
.clip-title { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { flex: none; }

/* live site */
.embed .stage { flex: 1; width: 100%; min-height: 0; box-shadow: 4px 6px 0 0 rgba(0,0,0,0.1); }
.embed .viewport { background: #fff; }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.embed .meta { justify-content: center; }

/* video reel */
.reel .stage {
  width: 320px; height: 180px;
  box-shadow: 4px 6px 0 0 rgba(0,0,0,0.12);
  transition: width 0.35s cubic-bezier(.3,.8,.3,1), height 0.35s cubic-bezier(.3,.8,.3,1);
}
.reel .track { height: 100%; transition: transform 0.5s cubic-bezier(.3,.9,.3,1); }
.reel .slide { height: 100%; }
.reel video {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  border: 0; border-radius: 0; margin: 0;
  background: #161616;
  cursor: pointer;
}
.stage:fullscreen { background: #161616; }
.stage:fullscreen .viewport { inset: 0; }
.stage:fullscreen .frame { display: none; }

.side button {
  font: inherit;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  padding: 0;
}
.side button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side button:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }

/* big up/down arrows */
.arrow {
  flex: none;
  width: 62px; height: 56px;
  display: grid; place-items: center;
  border: 3px solid var(--ink);
  border-radius: 58% 42% 55% 45% / 47% 56% 44% 53%;
  box-shadow: 3px 4px 0 0 rgba(0,0,0,0.12);
  transition: transform 0.15s ease-out, opacity 0.2s, background 0.15s;
}
.arrow.down { border-radius: 45% 55% 42% 58% / 53% 44% 56% 47%; }
.arrow svg { width: 32px; height: 32px; stroke-width: 2.8; transition: translate 0.15s ease-out; }
.arrow:hover:not(:disabled) { background: #f3f3f3; transform: rotate(-4deg) scale(1.08); }
.arrow.up:hover:not(:disabled) svg { translate: 0 -3px; }
.arrow.down:hover:not(:disabled) svg { translate: 0 3px; }
.arrow:active:not(:disabled) { transform: scale(0.95); box-shadow: none; }
.arrow:disabled { opacity: 0.25; cursor: default; box-shadow: none; }

.big-play {
  position: absolute;
  left: 50%; top: 50%;
  width: 78px; height: 72px;
  translate: -50% -50%;
  display: grid; place-items: center;
  padding-left: 5px !important;
  border: 3px solid var(--ink);
  border-radius: 58% 42% 55% 45% / 47% 56% 44% 53%;
  box-shadow: 3px 4px 0 0 rgba(0,0,0,0.3);
  transition: transform 0.15s ease-out, opacity 0.2s;
  z-index: 2;
}
.big-play svg { width: 34px; height: 34px; stroke-width: 2.8; }
.big-play:hover { transform: rotate(-5deg) scale(1.08); }
.reel.playing .big-play { opacity: 0; pointer-events: none; }

.controls { display: flex; align-items: center; gap: 4px; }
.ctl {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0;
  background: none !important;
  transition: transform 0.15s ease-out, color 0.15s;
}
.ctl svg { width: 21px; height: 21px; stroke-width: 2.4; }
.ctl:hover { color: var(--c, var(--ink)); transform: rotate(-8deg) scale(1.15); }
.time { flex: none; font-size: 0.85em; color: var(--ink-soft); min-width: 82px; text-align: center; }

/* seek bar: a pen line that fills in, with a scribbled knob */
.seek {
  --p: 0%;
  flex: 1;
  min-width: 50px;
  height: 24px;
  margin: 0 6px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--ink) var(--p), #d6d6d6 var(--p));
}
.seek::-moz-range-track { height: 4px; border-radius: 3px; background: #d6d6d6; }
.seek::-moz-range-progress { height: 4px; border-radius: 3px; background: var(--ink); }
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 17px;
  margin-top: -7px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 58% 42% 55% 45% / 47% 56% 44% 53%;
}
.seek::-moz-range-thumb {
  width: 13px; height: 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 58% 42% 55% 45% / 47% 56% 44% 53%;
}
.seek:focus { outline: none; }
.seek:focus-visible::-webkit-slider-thumb { outline: 2px dashed var(--ink); outline-offset: 3px; }

.clips[hidden] { display: none; }

/* narrow (phones, small windows): stack the two halves */
@media (max-width: 759px) {
  .on-wide { display: none; }
  .on-narrow { display: inline; }
  main.split-on { display: flex; flex-direction: column; height: auto; }
  main.split-on .text { overflow: visible; padding: 22px 20px 32px; }
  .side { padding: 18px 16px 40px; overflow: visible; }
  .side .divider { display: none; }
  .reel { order: -1; padding-bottom: 8px; }
  .embed .stage { flex: none; height: 82vh; height: 82svh; }
  .arrow { width: 54px; height: 48px; }
  .arrow svg { width: 28px; height: 28px; }
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78em;
  background: #f2f2f2;
  padding: 1px 6px;
  border-radius: 4px;
}

/* one video in the page flow (data-inline) */
.side.inline { padding: 0; margin: 4px 0 30px; overflow: visible; align-items: stretch; }
.side.inline .stage { align-self: center; }
.side.inline .meta, .side.inline .controls { align-self: center; }
@media (max-width: 759px) { .side.inline { padding: 0; } }
