:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #18160f;
  --muted: #6d695e;
  --line: #ece8dc;
  --yellow: #f3cb2f;
  --yellow-deep: #d9ae12;
  --soft: #fff8dc;
  /* Aptos ships with Windows 11 and Microsoft 365; it can't be self-hosted, so others get their system sans. */
  --display: 'Aptos Display', Aptos, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: Aptos, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: min(1120px, 100% - 2.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
::selection { background: var(--yellow); }
:focus-visible { outline: 3px solid var(--yellow-deep); outline-offset: 3px; border-radius: 6px; }

.wrap { width: var(--wrap); margin-inline: auto; }
.eyebrow {
  font: 600 0.8rem/1 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow-deep);
  margin: 0 0 0.9rem;
}
h2 { font: 600 clamp(2.2rem, 5vw, 3.4rem)/1.05 var(--display); margin: 0 0 2rem; letter-spacing: -0.01em; }

/* Nav: just text, quiet until you've scrolled past the hero */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: flex; justify-content: flex-end; gap: 1.6rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  font: 500 0.98rem/1 var(--display);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}
.nav.on { opacity: 1; transform: none; pointer-events: auto; }
.nav a { text-decoration: none; color: var(--ink); opacity: 0.5; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current] { opacity: 1; }

/* Hero */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 520px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 58%, var(--soft) 0, rgba(255,248,220,0) 38%),
    radial-gradient(rgba(24,22,15,0.07) 1.2px, transparent 1.3px) 0 0 / 26px 26px;
}
.hero h1 {
  position: absolute; z-index: 1;
  left: clamp(1.25rem, 6vw, 6rem); top: 50%; transform: translateY(-58%);
  margin: 0;
  font: 700 clamp(3.4rem, 11.5vw, 11rem)/0.88 var(--display);
  letter-spacing: -0.03em;
}
.hero h1 span { display: block; }
.hero h1 .name { color: var(--ink); position: relative; }
.hero h1 .name::after {
  content: ''; position: absolute; left: 0.04em; right: 0.1em; bottom: 0.06em; height: 0.2em;
  background: var(--yellow); z-index: -1; border-radius: 0.1em;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; opacity: 0; transition: opacity 0.8s; }
.hero.ready canvas { opacity: 1; }
/* Scroll hint: one small chevron, gently bobbing */
.scroll {
  position: absolute; z-index: 3; left: 50%; bottom: 1.8rem; width: 44px; height: 44px; margin-left: -22px;
  display: grid; place-items: center; color: var(--muted); border-radius: 50%;
}
.scroll::before {
  content: ''; width: 14px; height: 14px; margin-top: -8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
  animation: bob 1.8s ease-in-out infinite;
}
.scroll:hover { color: var(--ink); }
@keyframes bob { 50% { translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .scroll::before { animation: none; } }

@media (max-aspect-ratio: 1/1) {
  .hero h1 { top: 15%; transform: none; font-size: clamp(3.2rem, 17vw, 8rem); }
}

/* Sections */
section.block { padding: clamp(5rem, 11vw, 8rem) 0; scroll-margin-top: 2rem; }
section.block + section.block { border-top: 1px solid var(--line); }

/* Showcase */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.card {
  position: relative; display: grid; gap: 1.2rem; align-content: start;
  padding: 1.8rem; border: 2.5px solid var(--ink); border-radius: 22px; background: #fff;
  text-decoration: none; box-shadow: 6px 6px 0 var(--yellow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--yellow); }
.card:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--yellow); }
.card { padding: 0 0 1.6rem; overflow: hidden; }
.card > :not(.card-thumb):not(.tag) { margin-inline: 1.6rem; }
.card-thumb {
  aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--soft);
  border-bottom: 2.5px solid var(--ink); font: 700 4.5rem/1 var(--display); color: var(--yellow-deep);
}
.card-thumb { position: relative; overflow: hidden; } /* keeps the 16:9 box whatever the photo's size */
.card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .tag { background: #fff; border: 2px solid var(--ink); color: var(--ink); top: 1rem; right: 1rem; }
.card .go::after { content: ' →'; }
.card h3 { margin: 0; font: 600 1.9rem/1 var(--display); }
.card p { margin: 0; color: var(--muted); }
.card .go { font: 600 0.95rem/1 var(--display); display: inline-flex; gap: 0.4rem; align-items: center; }
.tag {
  position: absolute; top: 1.6rem; right: 1.6rem;
  font: 600 0.72rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.45rem 0.65rem; border-radius: 999px; background: var(--soft); color: var(--yellow-deep);
}

/* About */
.about { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .about { grid-template-columns: 1.2fr 1fr; } }
.dance {
  position: relative; aspect-ratio: 4 / 5; max-height: 560px; width: 100%;
  border-radius: 28px; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 62%, var(--soft) 0, rgba(255,248,220,0) 60%),
    radial-gradient(rgba(24,22,15,0.07) 1.2px, transparent 1.3px) 0 0 / 22px 22px;
}
.dance canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s; }
.dance.ready canvas { opacity: 1; }
.about p { margin: 0 0 1rem; font-size: 1.15rem; }
.about p a { text-decoration-color: var(--yellow-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Feed */
.empty { color: var(--muted); }

.composer {
  display: grid; gap: 0.7rem; padding: 1.2rem; margin-bottom: 1.5rem;
  border: 2px dashed var(--yellow-deep); border-radius: 18px; background: var(--soft);
}
input, textarea {
  font: inherit; color: inherit; width: 100%;
  padding: 0.75rem 0.9rem; border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--yellow-deep); }
textarea { min-height: 7rem; resize: vertical; }
.btn {
  font: 600 1rem/1 var(--display); cursor: pointer;
  padding: 0.8rem 1.3rem; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--yellow); color: var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.link-btn { font: 500 0.85rem/1 var(--body); background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }
.row { display: flex; gap: 0.8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.error { color: #b3261e; font-size: 0.9rem; margin: 0; min-height: 1.2em; }

/* Footer */
footer { padding: 4rem 0 2rem; border-top: 1px solid var(--line); overflow: hidden; }
.wordmark {
  font: 700 clamp(3rem, 13.5vw, 12.5rem)/0.9 var(--display); letter-spacing: -0.035em;
  margin: 0 0 2.2rem; white-space: nowrap;
}
.wordmark b { color: var(--yellow); font-weight: inherit; -webkit-text-stroke: 0.02em var(--ink); paint-order: stroke fill; }
.legal { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: center; font-size: 0.85rem; color: var(--muted); }
.legal a { text-decoration: none; }
.legal a:hover { color: var(--ink); }
.legal .who { margin-left: auto; opacity: 0.45; transition: opacity 0.2s; font: 500 0.8rem/1 var(--display); background: none; border: 0; padding: 0; color: inherit; cursor: pointer; }
.legal .who:hover { opacity: 1; }

/* Sign-in dialog */
dialog {
  width: min(380px, 100% - 2rem); padding: 1.8rem; border: 2.5px solid var(--ink); border-radius: 22px;
  box-shadow: 8px 8px 0 var(--yellow);
}
dialog::backdrop { background: rgba(24,22,15,0.35); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.7rem; margin-bottom: 0.3rem; }
dialog p { margin: 0 0 1.2rem; color: var(--muted); font-size: 0.92rem; }
dialog form { display: grid; gap: 0.7rem; }

/* Plain pages (privacy, terms) */
.page { padding: 7rem 0 4rem; max-width: 44rem; }
.page h1 { font: 700 clamp(2.4rem, 6vw, 3.6rem)/1 var(--display); margin: 0 0 1.5rem; }
.page h2 { font-size: 1.4rem; margin: 2rem 0 0.6rem; }
.page .back { font: 600 0.95rem/1 var(--display); text-decoration: none; }

/* The hidden attribute always wins (author display rules would otherwise override it). */
[hidden] { display: none !important; }

/* Feed cards */
.write-link { display: inline-block; text-decoration: none; margin-bottom: 1.6rem; }
.feed { max-width: none; display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.post-card {
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  border: 2px solid var(--line); border-radius: 20px; text-decoration: none; background: #fff;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 6px 0 var(--yellow); }
.post-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--soft); }
.post-card > div { padding: 1.1rem 1.2rem 1.3rem; }
.post-card time { font: 500 0.8rem/1 var(--display); color: var(--muted); }
.post-card h3 { margin: 0.45rem 0 0.35rem; font: 600 1.3rem/1.2 var(--display); }
.post-card p { margin: 0; color: var(--muted); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* Inner pages */
.inner .nav { background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); }
.nav .home { margin-right: auto; opacity: 1; font-weight: 700; }
.full time { font: 500 0.85rem/1 var(--display); color: var(--muted); display: block; margin-top: 1.8rem; }
.full h1 { margin: 0.6rem 0 1.4rem; }
.full .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.1rem; line-height: 1.7; }

/* Post page widgets */
/* Cover: full column width, 16:9, never taller than 60% of the screen (or 480px). */
.full .cover { width: 100%; aspect-ratio: 16 / 9; height: auto; max-height: min(60vh, 480px); object-fit: cover; border-radius: clamp(14px, 3vw, 22px); margin-top: 1.6rem; background: var(--soft); }
.blocks { display: grid; gap: 1.4rem; margin-bottom: 2.5rem; }
.b-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.1rem; line-height: 1.7; }
.b-text a, .b-quote a { color: var(--ink); text-decoration-color: var(--yellow-deep); text-decoration-thickness: 2px; }
.b-heading { font-size: 1.7rem; margin: 1rem 0 -0.4rem; }
.b-quote { margin: 0; padding: 0.4rem 0 0.4rem 1.2rem; border-left: 5px solid var(--yellow); font: 500 1.3rem/1.5 var(--display); white-space: pre-wrap; }
.b-divider { border: 0; height: 4px; width: 64px; margin: 1rem auto; background: var(--yellow); border-radius: 4px; }
.blocks figure { margin: 0; }
.blocks figure img, .blocks figure video { width: 100%; max-height: 80vh; object-fit: contain; border-radius: 16px; background: var(--soft); }
.blocks figcaption { margin-top: 0.5rem; font-size: 0.88rem; color: var(--muted); text-align: center; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Editor */
.editor { display: grid; gap: 0.9rem; margin-top: 1.5rem; }
.widget { border: 2px solid var(--line); border-radius: 18px; padding: 0.8rem 1rem 1rem; background: #fff; }
.widget.fixed { border-color: var(--yellow); background: var(--soft); }
.widget .label { display: block; font: 600 0.72rem/1 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow-deep); margin-bottom: 0.6rem; }
.widget-bar { display: flex; justify-content: space-between; align-items: center; }
.widget-bar .label { margin: 0; }
.tools { display: flex; gap: 0.25rem; }
.tools button { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 0.95rem; line-height: 1; color: var(--ink); }
.tools button:hover { border-color: var(--ink); }
.widget-body { display: grid; gap: 0.6rem; margin-top: 0.7rem; }
#blocks { display: grid; gap: 0.9rem; }
#blocks:empty { display: none; }
.title-input { font: 700 1.6rem/1.2 var(--display); border-color: transparent; background: #fff; }
.w-heading input { font: 600 1.25rem/1.2 var(--display); }
.w-quote textarea { font: 500 1.1rem/1.5 var(--display); border-left: 5px solid var(--yellow); }
.widget textarea { min-height: 0; overflow: hidden; }
.w-text textarea { min-height: 7rem; }
.w-divider .widget-body::before { content: ''; height: 4px; width: 64px; margin: 0.4rem auto; background: var(--yellow); border-radius: 4px; }
.drop {
  width: 100%; padding: 1.4rem; border: 2px dashed var(--yellow-deep); border-radius: 14px;
  background: rgba(255,255,255,0.6); color: var(--ink); font: 600 0.95rem/1.2 var(--display); cursor: pointer;
}
.drop:hover { background: #fff; }
.thumb-preview, .media-slot { position: relative; border-radius: 14px; overflow: hidden; background: var(--soft); }
.thumb-preview img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.media-slot img, .media-slot video { width: 100%; max-height: 360px; object-fit: contain; display: block; }
.thumb-preview .x {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(24,22,15,0.75); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}
.loading > img, .loading > video { opacity: 0.45; }
.failed { outline: 3px solid #b3261e; }
.progress { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--yellow-deep); transition: width 0.2s; }
input.bad { border-color: #b3261e; }
.adders { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; padding: 0.9rem 1rem; border: 2px dashed var(--line); border-radius: 18px; }
.adders span { font: 600 0.85rem/1 var(--display); color: var(--muted); margin-right: 0.3rem; }
.adders button {
  font: 600 0.9rem/1 var(--display); padding: 0.6rem 0.9rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
.adders button:hover { background: var(--yellow); }
.publish { position: sticky; bottom: 0; padding: 0.8rem 0; background: linear-gradient(transparent, #fff 35%); }

/* links.harryhugsbugs.com */
.tree { min-height: 100vh; min-height: 100svh;
  background: radial-gradient(circle at 50% 0, var(--soft) 0, rgba(255,248,220,0) 55%),
    radial-gradient(rgba(24,22,15,0.07) 1.2px, transparent 1.3px) 0 0 / 26px 26px;
  background-color: var(--bg); }
.tree main { width: min(480px, 100% - 2.5rem); margin: 0 auto; padding: 2.5rem 0 2.5rem; text-align: center; }
.tree-dance { width: 300px; height: 360px; max-width: 100%; aspect-ratio: auto; margin: -2.5rem auto -1.5rem; background: none; border-radius: 0; }
.tree h1 { font: 700 2.2rem/1 var(--display); letter-spacing: -0.02em; margin: 0.4rem 0 0.5rem; }
.tree h1 b { color: var(--yellow); -webkit-text-stroke: 0.02em var(--ink); paint-order: stroke fill; }
.tree main > p { margin: 0 0 2rem; color: var(--muted); }
.tree-list { display: grid; gap: 0.75rem; }
.tree-link {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem; position: relative;
  padding: 1rem 1.2rem; border: 2px solid var(--ink); border-radius: 16px; background: #fff;
  font: 600 1.02rem/1 var(--display); text-decoration: none; box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.tree-link svg, .tree-link img { position: absolute; left: 1rem; width: 26px; height: 26px; fill: currentColor; border-radius: 7px; }
.tree-link.globatics { background: #5E1431; color: #FBE3EC; box-shadow: 4px 4px 0 #E98AB2; border-color: #5E1431; }
.tree-link.flow { background: #0F2B38; color: #8EE3D6; box-shadow: 4px 4px 0 #8EE3D6; border-color: #0F2B38; }
.tree-link.email { background: #FBE3EC; color: #5E1431; box-shadow: 4px 4px 0 #5E1431; border-color: #5E1431; }
.tree-link.globatics:hover { background: #75193d; box-shadow: 6px 6px 0 #E98AB2; }
.tree-link.flow:hover { background: #153a4b; box-shadow: 6px 6px 0 #8EE3D6; }
.tree-link.email:hover { background: #F4A6C6; box-shadow: 6px 6px 0 #5E1431; }
.tree-link:hover { background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.tree-link:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.tree footer { margin-top: 2.5rem; font-size: 0.85rem; color: var(--muted); }
.tree footer a { text-decoration: none; }

.post-tag { position: static; display: inline-block; margin-top: 1.4rem; }
.full .post-tag + time { margin-top: 0.8rem; }
.edit-link { display: inline-block; text-decoration: none; margin-right: 1rem; }

/* Drafts */
.btn.ghost { background: #fff; }
.publish .error { flex: 1; }
.draft-badge { display: inline-block; font: 600 0.72rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0.6rem; border-radius: 999px; background: var(--ink); color: #fff; margin-bottom: 0.6rem; }
.card .tag.draft-badge { background: var(--ink); color: #fff; }
.draft-note { margin: 1.4rem 0 0; padding: 0.8rem 1rem; border: 2px dashed var(--ink); border-radius: 14px; background: var(--soft); font-weight: 600; }
