:root {
  --ink: #1a1a1a;
  --paper: #faf8f3;
  --muted: #6b6b6b;
  --rule: #1a1a1a;
  --accent: #1a1a1a;
  --sun-1: #f0d6a8;
  --sun-2: #e9a472;
  --sun-3: #c25a3a;
  --content: 680px;
  --sky-h: 3.5rem;
  --pad: 2rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover, a:focus-visible { text-decoration: underline; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.sun {
  margin: 0;
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  white-space: pre;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  text-align: left;
  background: linear-gradient(180deg, #f0d6a8 0%, #e9a472 55%, #b9532f 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  z-index: 3;
  pointer-events: none;
}
@media (max-width: 540px) { .sun { font-size: 0.7rem; } }

.sky-art {
  background: linear-gradient(
    180deg,
    #4b2a8a 0%,
    #8e2aa8 12%,
    #d62f8a 24%,
    #ee3d6a 36%,
    #f55a3f 48%,
    #ff8a2a 60%,
    #ffc234 72%,
    #ff6a1a 86%,
    #b81810 100%
  );
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent !important;
  opacity: 1 !important;
}

header.top {
  width: 100%;
  padding-top: 0.5rem;
}

nav.top-nav {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 1.25rem;
  font-size: 0.85rem;
  padding: 1.5rem var(--pad) 0;
}
nav.top-nav a { color: var(--muted); }
nav.top-nav a:hover, nav.top-nav a:focus-visible { color: var(--accent); }

.sky {
  position: relative;
  width: 100%;
  height: var(--sky-h);
  overflow: hidden;
  margin-top: 0;
}
.sky span {
  position: absolute;
  white-space: pre;
  will-change: transform;
  font-size: 0.95rem;
  color: var(--ink);
}
.sky span.cloud { color: var(--muted); }

@keyframes undulate {
  0%   { -webkit-mask-position: 0 0;     mask-position: 0 0; }
  100% { -webkit-mask-position: -20px 0; mask-position: -20px 0; }
}

.horizon {
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    #1a1a1a 0%, #1a1a1a 28%,
    #6a2418 38%, #b9532f 45%,
    #e8762e 48%, #f1b66b 50%,
    #e8762e 52%, #b9532f 55%,
    #6a2418 62%, #1a1a1a 72%, #1a1a1a 100%
  );
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4' viewBox='0 0 20 4'%3E%3Cpath d='M0 2 Q 5 4 10 2 T 20 2' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4' viewBox='0 0 20 4'%3E%3Cpath d='M0 2 Q 5 4 10 2 T 20 2' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-x;
          mask-repeat: repeat-x;
  animation: undulate 2s linear infinite;
}

.ocean {
  position: relative;
  flex: 1 0 auto;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@keyframes wave-undulate {
  0%   { -webkit-mask-position: 0 0;     mask-position: 0 0; }
  100% { -webkit-mask-position: -20px 0; mask-position: -20px 0; }
}
.ocean .wave {
  position: absolute;
  height: 4px;
  will-change: transform;
  pointer-events: none;
  background: #8a8a8a;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4' viewBox='0 0 20 4'%3E%3Cpath d='M0 2 Q 5 4 10 2 T 20 2' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4' viewBox='0 0 20 4'%3E%3Cpath d='M0 2 Q 5 4 10 2 T 20 2' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-x;
          mask-repeat: repeat-x;
  animation: wave-undulate 2s linear infinite;
}
.ocean .wave.muted { background: #b0b0b0; }

.ocean .boat {
  position: absolute;
  will-change: transform;
  pointer-events: none;
}
.ocean .boat .boat-art {
  margin: 0;
  white-space: pre;
  font-family: inherit;
  font-size: 0.42rem;
  line-height: 1;
  color: var(--ink);
}
.ocean .boat.flipped .boat-art {
  transform: scaleX(-1);
  transform-origin: center;
}
@media (max-width: 540px) {
  .ocean .boat .boat-art { font-size: 0.36rem; }
}

main.center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1 0 auto;
  padding: 6rem var(--pad);
}

.center-inner {
  width: auto;
  max-width: var(--content);
  position: relative;
}

.wordmark {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 0.75rem;
}

.tagline {
  color: var(--muted);
  margin: 0 0 3rem;
  font-size: 0.9rem;
}

form.signup {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 auto;
}
form.signup input[type="email"] {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 0.35rem 0.25rem;
  width: 22ch;
  border-radius: 0;
  outline: none;
}
form.signup input[type="email"]:focus-visible { border-bottom-color: var(--accent); }
form.signup input[type="email"]::placeholder { color: var(--muted); }
form.signup input[type="email"]:-webkit-autofill,
form.signup input[type="email"]:-webkit-autofill:hover,
form.signup input[type="email"]:-webkit-autofill:focus,
form.signup input[type="email"]:-webkit-autofill:active,
form.signup input[type="email"]:autofill,
form.signup input[type="email"]:autofill:hover,
form.signup input[type="email"]:autofill:focus,
form.signup input[type="email"]:autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--paper) inset !important;
  box-shadow: 0 0 0 1000px var(--paper) inset !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  background-clip: text !important;
  transition: background-color 5000s ease-in-out 0s;
}
form.signup button {
  font: inherit;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  border-radius: 0;
}
form.signup button:hover, form.signup button:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}
form.signup button[disabled] { opacity: 0.4; cursor: default; }

.form-status {
  min-height: 1.4em;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.form-status.err { color: var(--ink); font-style: italic; }

.builders-count {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.next-issue {
  margin-top: 0.75rem;
  color: var(--ink);
  font-size: 0.9rem;
  text-align: center;
}
.next-issue a {
  color: var(--ink);
  transition: background-position 0.4s ease;
}
.next-issue a:hover, .next-issue a:focus-visible {
  background: linear-gradient(90deg, #f0d6a8 0%, #e9a472 55%, #b9532f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ocean .ripple {
  position: absolute;
  white-space: pre;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 3.5s ease-in-out;
  pointer-events: none;
  color: var(--muted);
}
.ocean .ripple.show { opacity: 0.7; }

/* ---- firework ---- */
@keyframes firework-explode {
  0% { transform: scale(0.1) translateY(100px); opacity: 0; }
  20% { transform: scale(0.5) translateY(0); opacity: 1; }
  80% { transform: scale(1.1) translateY(0); opacity: 1; }
  100% { transform: scale(1.2) translateY(20px); opacity: 0; }
}
@keyframes fw-color {
  0% { color: var(--accent); }
  25% { color: #e8762e; }
  50% { color: #f1b66b; }
  75% { color: #a82b3d; }
  100% { color: var(--accent); }
}
.firework-container {
  position: absolute;
  top: -120px;
  pointer-events: none;
  z-index: 50;
  font-size: 0.5rem;
  line-height: 1;
  white-space: pre;
  display: none;
}
.fw-left { left: -200px; } 
.fw-right { right: -200px;}
.fw-left.active {
  display: block;
  animation: firework-explode 2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
.fw-right.active {
  display: block;
  animation: firework-explode 2.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards 0.2s;
}
.firework-container span {
  animation: fw-color 0.6s linear infinite;
}

footer.bottom {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1.25rem var(--pad) 1.5rem;
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.footer-left { text-align: left; }
.footer-center { text-align: center; }
.footer-right { text-align: right; }
footer.bottom a { color: var(--muted); }
footer.bottom a:hover, footer.bottom a:focus-visible { color: var(--accent); }
footer.bottom .sep { padding: 0 0.5em; }

@media (max-width: 768px) {
  footer.bottom {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  .footer-left, .footer-right { text-align: center; }
}

@media (max-width: 540px) {
  :root { --pad: 1.25rem; --sky-h: 3rem; }
  html, body { font-size: 14px; }
  main.center { padding: 4rem var(--pad); }
  .tagline { margin-bottom: 2.25rem; }
  form.signup input[type="email"] { width: 18ch; }
}

/* ---- about page ---- */
.about-bio {
  color: var(--ink);
  font-size: 0.95rem;
  margin: 0 auto 2.5rem;
  max-width: 78ch;
  line-height: 1.65;
  text-align: left;
}
.about-bio em { color: var(--muted); font-style: italic; }

/* --- issue (rendered markdown) --- */
.issue-inner { width: 100%; max-width: 680px; }
.issue-content {
  text-align: left;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 auto;
  padding: 1rem 0 2rem;
}
.issue-content h1 {
  font-size: 1.6rem;
  font-weight: 500;
  margin: 0.5rem 0 1.5rem;
  letter-spacing: -0.5px;
}
.issue-content h2 {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 2rem 0 0.75rem;
}
.issue-content h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 1.5rem 0 0.5rem;
  color: var(--muted);
}
.issue-content p { margin: 0 0 1rem; }
.issue-content ul, .issue-content ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.issue-content li { margin-bottom: 0.4rem; }
.issue-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}
.issue-content a:hover { text-decoration-color: var(--ink); }
.issue-content blockquote {
  border-left: 2px solid #b9532f;
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--muted);
  font-style: italic;
}
.issue-content code {
  background: #f0ede5;
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  font-size: 0.88em;
}
.issue-content pre {
  background: #f0ede5;
  border-left: 2px solid #b9532f;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}
.issue-content pre code { background: transparent; padding: 0; }
.issue-content hr {
  border: none;
  border-top: 1px solid var(--muted);
  margin: 2rem 0;
  opacity: 0.4;
}
.issue-content img { max-width: 100%; height: auto; }
.issue-loading, .issue-error {
  color: var(--muted);
  text-align: center;
  font-style: italic;
  padding: 2rem 0;
}
.tagline .cite {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.about-bio a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.about-bio a:hover, .about-bio a:focus-visible {
  text-decoration-color: var(--ink);
}

.frame {
  position: relative;
  width: 360px;
  max-width: 100%;
  aspect-ratio: 132 / 111; /* matches JetBrains Mono rendering of 220x111 ascii */
  margin: 0 auto;
  border: 1px solid var(--ink);
  cursor: crosshair;
  background: var(--paper);
  overflow: hidden;
}
.frame .corner {
  position: absolute;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--ink);
  background: var(--paper);
  padding: 0 2px;
  user-select: none;
  pointer-events: none;
}
.frame .corner.tl { top: -0.55em; left: -0.35em; }
.frame .corner.tr { top: -0.55em; right: -0.35em; }
.frame .corner.bl { bottom: -0.55em; left: -0.35em; }
.frame .corner.br { bottom: -0.55em; right: -0.35em; }

.frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.35s ease;
}
/* the ASCII portrait is rendered at its natural pixel size (220 chars * 6px * 0.6
   wide = ~792px, 111 lines * 6px = 666px) and then scaled down to fit the frame
   via transform. font-size stays large enough to actually render. */
.frame-ascii {
  position: absolute;
  top: 0;
  left: 0;
  width: 792px;
  height: 666px;
  margin: 0;
  padding: 0;
  white-space: pre;
  font-family: inherit;
  font-size: 6px;
  line-height: 1;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
  transform-origin: top left;
  transform: scale(calc(360 / 792));
  opacity: 0;
  transition: opacity 0.35s ease;
}
.frame:hover .frame-img,
.frame:focus-within .frame-img { opacity: 0; }
.frame:hover .frame-ascii,
.frame:focus-within .frame-ascii { opacity: 1; }

.frame-wrap {
  position: relative;
  display: inline-block;
}
.wife-tag {
  position: absolute;
  right: -56px;
  bottom: -32px;
  width: 416px;
  height: 130px;
  color: #a82b3d; /* brighter bordeaux */
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: visible;
}
.wife-tag .wife-label {
  font-family: "Caveat", cursive;
  font-size: 30px;
  font-weight: 700;
  fill: #6e1f2a;
}
.frame-wrap:hover .wife-tag,
.frame-wrap:focus-within .wife-tag { opacity: 0; }

@media (max-width: 540px) {
  .frame { width: 280px; }
  .frame-ascii { transform: scale(calc(280 / 792)); }
  .wife-tag { right: -30px; bottom: -28px; width: 310px; height: 110px; }
  .wife-tag .wife-label { font-size: 26px; }
}

/* ---- personal site: socials, sections, projects, graveyard ---- */
.socials {
  list-style: none;
  padding: 0;
  margin: 2.25rem 0 3.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.socials li { display: inline-flex; align-items: center; }
.socials li + li::before {
  content: "·";
  color: var(--muted);
  padding: 0 0.7em;
  opacity: 0.6;
}
.socials a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.socials a:hover, .socials a:focus-visible {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(90deg, #f0d6a8 0%, #e9a472 55%, #b9532f 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section {
  text-align: left;
  margin: 3rem auto 0;
  max-width: 78ch;
}
.section-title {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.12);
}
.section-title.graveyard-title {
  color: #a82b3d;
  border-bottom-color: rgba(168, 43, 61, 0.25);
}

.proj-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.proj {
  padding: 0.85rem 0;
  border-bottom: 1px dashed rgba(26, 26, 26, 0.1);
}
.proj:last-child { border-bottom: none; }
.proj-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.proj-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
a.proj-name {
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a.proj-name:hover { text-decoration-color: var(--ink); }
.proj-desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.proj-desc a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 26, 0.2);
  text-underline-offset: 3px;
}
.proj-desc a:hover { color: var(--ink); text-decoration-color: var(--ink); }

.tag {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  padding: 0.1rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  line-height: 1.4;
  white-space: nowrap;
}
.tag-live    { color: #b9532f; }
.tag-wip     { color: #6b6b6b; position: relative; }
.tag-wip::after {
  content: "_";
  display: inline-block;
  margin-left: 0.15em;
  animation: blink 1.1s steps(1) infinite;
}
.tag-shipped { color: var(--ink); }
.tag-died    { color: #8a8a8a; }
@keyframes blink { 50% { opacity: 0; } }

.proj-dead .proj-name {
  color: #8a8a8a;
  text-decoration: line-through;
  text-decoration-color: rgba(138, 138, 138, 0.5);
}
.proj-dead .proj-desc { color: #8a8a8a; font-style: italic; }

.graveyard-intro {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
  margin: 0 0 1rem;
}

.wave-divider {
  width: 60%;
  max-width: 320px;
  height: 4px;
  margin: 3.5rem auto;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #b9532f 30%,
    #e8762e 50%,
    #b9532f 70%,
    transparent 100%
  );
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4' viewBox='0 0 20 4'%3E%3Cpath d='M0 2 Q 5 4 10 2 T 20 2' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='4' viewBox='0 0 20 4'%3E%3Cpath d='M0 2 Q 5 4 10 2 T 20 2' fill='none' stroke='black' stroke-width='1.5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-x;
          mask-repeat: repeat-x;
  opacity: 0.7;
}

.newsletter-cta {
  text-align: center;
  margin-top: 3.5rem;
  font-size: 0.95rem;
}
.newsletter-cta p { margin: 0; color: var(--muted); }
.newsletter-cta a {
  color: var(--ink);
  background: linear-gradient(90deg, #f0d6a8 0%, #e9a472 55%, #b9532f 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  font-weight: 500;
}
.newsletter-cta a:hover { text-decoration: underline; }

nav.top-nav { gap: 1.5rem; }

@media (max-width: 540px) {
  .socials { font-size: 0.82rem; margin: 1.75rem 0 2.5rem; }
  .socials li + li::before { padding: 0 0.45em; }
  .section { margin-top: 2.25rem; }
  .wave-divider { margin: 2.5rem auto; }
  nav.top-nav { gap: 1rem; flex-wrap: wrap; justify-content: center; }
}
