:root {
  --ink: #f2efe9;
  --ink-dim: rgba(242, 239, 233, 0.62);
  --ink-faint: rgba(242, 239, 233, 0.34);
  --rule: rgba(242, 239, 233, 0.16);
  --measure: 34rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #10141b;
}

body {
  color: var(--ink);
  font: 400 clamp(1.05rem, 0.98rem + 0.42vw, 1.22rem)/1.6
        ui-serif, Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The generated landscape. Fixed and behind everything; the text never has to
   compete with it because the renderer keeps its contrast low by design. */
#scenery {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  padding: min(22vh, 9rem) 1.5rem 5rem;
}

.noscript {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  color: var(--ink-dim);
}

/* --- the day's entry ---------------------------------------------------- */

.entry h1 {
  margin: 0 0 1.4rem;
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--ink-dim);
}

.entry .body p {
  margin: 0 0 1.15rem;
  font-size: 1.28em;
  line-height: 1.52;
  text-wrap: pretty;
}

.entry .body p:last-child { margin-bottom: 0; }

.stamp {
  margin: 2rem 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* --- weather contrast table -------------------------------------------- */

.weather {
  margin: 4.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.weather table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.84rem;
}

.weather th,
.weather td {
  padding: 0.3rem 0.6rem 0.3rem 0;
  text-align: left;
  font-weight: 400;
  vertical-align: baseline;
  white-space: nowrap;
}

.weather th {
  width: 5.5rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.weather tr.you td { color: var(--ink); }
.weather tr:not(.you) td { color: var(--ink-dim); }
.weather .temp { text-align: right; width: 4rem; }
.weather .desc { white-space: normal; }

.aside {
  margin: 1.25rem 0 0;
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-faint);
  max-width: 26rem;
}

/* --- ask box ------------------------------------------------------------ */

.ask {
  margin: 4rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.ask label {
  display: block;
  margin-bottom: 0.6rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#ask-form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

#ask-input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: inherit;
  font-size: 0.95rem;
}

#ask-input::placeholder { color: var(--ink-faint); }

#ask-input:focus-visible,
#ask-form button:focus-visible {
  outline: 2px solid var(--ink-dim);
  outline-offset: 2px;
}

#ask-form button {
  padding: 0.6rem 1.1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink-faint);
  border-radius: 2px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

#ask-form button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); }
#ask-form button:disabled { opacity: 0.45; cursor: default; }

#ask-answer {
  display: block;
  margin-top: 1.25rem;
  min-height: 1px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-dim);
  white-space: pre-wrap;
}

#ask-answer.thinking { color: var(--ink-faint); font-style: italic; }

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

footer {
  margin: 4.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-faint);
}

footer .who { margin: 0; }

footer a { color: var(--ink-dim); text-decoration-thickness: 1px; text-underline-offset: 2px; }
footer a:hover { color: var(--ink); }

.btc {
  margin: 1.1rem 0 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.9;
}

.btc-label {
  display: block;
  font-family: ui-serif, Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
}

.btc code { color: var(--ink-dim); word-break: break-all; }

/* --- plain / no-canvas page -------------------------------------------- */

.plain-page {
  background: #10141b;
}

.plain-page main {
  padding-top: 4rem;
  max-width: 40rem;
}

.plain-page h1 { font-weight: 400; font-size: 1.6rem; margin-top: 0; }
.plain-page h2 {
  margin-top: 3rem;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-family: ui-monospace, Menlo, monospace;
}
.plain-page h3 { font-weight: 400; font-style: italic; color: var(--ink-dim); }
.plain-page a { color: var(--ink-dim); }
.plain-page time {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.archive { list-style: none; padding: 0; }
.archive li { margin: 0 0 2.5rem; }

/* --- motion and contrast preferences ----------------------------------- */

@media (prefers-reduced-motion: reduce) {
  /* The renderer also checks this and draws a single static frame; this is the
     belt-and-braces half in case anything else animates. */
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink-dim: rgba(242, 239, 233, 0.85);
    --ink-faint: rgba(242, 239, 233, 0.65);
    --rule: rgba(242, 239, 233, 0.35);
  }
  main { background: rgba(8, 10, 14, 0.72); }
}

@media (max-width: 30rem) {
  main { padding-top: 12vh; }
  .weather th { width: 4.5rem; }
}

/* --- thinking out loud -------------------------------------------------- */

.thinking-out-loud {
  margin: 4rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.thinking-out-loud .label,
.ask label {
  margin: 0 0 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#thought {
  margin: 0;
  min-height: 3.2em;
  font-size: 1.14rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-dim);
  text-wrap: pretty;
}

/* A cursor that only blinks while there is something to blink after. */
#thought::after {
  content: "";
  display: inline-block;
  width: 0.5ch;
  height: 1em;
  margin-left: 0.15ch;
  vertical-align: -0.12em;
  background: var(--ink-faint);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #thought::after { animation: none; opacity: 0.5; }
}

.attribution {
  margin: 0.9rem 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 24rem;
}

/* --- live clocks in the conditions table -------------------------------- */

.weather .clock {
  /* Tabular figures so the seconds ticking doesn't shift the columns. */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: right;
  width: 5.5rem;
  color: var(--ink-faint);
}

.weather tr.you .clock { color: var(--ink-dim); }

@media (max-width: 34rem) {
  .weather .desc { display: none; }
  .weather th { width: 4rem; }
}

/* --- book time ---------------------------------------------------------- */

.booking {
  margin: 4rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.booking .label {
  margin: 0 0 0.9rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.booking-lede {
  margin: 0 0 1.4rem;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 28rem;
  text-wrap: pretty;
}

.tiers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tiers a {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--ink-faint);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.tiers a:hover { background: rgba(255, 255, 255, 0.07); }
.tiers a:focus-visible { outline: 2px solid var(--ink-dim); outline-offset: 2px; }

.tiers .duration {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.tiers .price {
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}

.booking-embed {
  display: block;
  width: 100%;
  /* Tall enough that the profile's event list isn't clipped, and tall enough
     for the month grid once a visitor picks a duration. */
  height: min(46rem, 90vh);
  margin: 1.5rem 0 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  /* Matches Cal.com's own dark theme so the frame doesn't read as a hole. */
  background: #101014;
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  .tiers a { transition: none; }
}

/* Price summary when the calendar is embedded: the frame is the interactive
   surface, so these are read-only and shouldn't look clickable. */
.tiers.static .tier {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink-dim);
}

.embed-fallback {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.embed-fallback a { color: var(--ink-dim); }

/* --- thinking out loud, promoted to the lead ---------------------------- */
/* The daily entry was removed from this page, so the thought stream is now the
   first and largest thing a visitor reads. It gets no top border (nothing is
   above it) and hero-scale type. */

.thinking-out-loud.lead {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.thinking-out-loud.lead #thought {
  min-height: 4.4em;
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.85rem);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: pretty;
}

.thinking-out-loud.lead .label { margin-bottom: 1.1rem; }

.thinking-out-loud.lead .attribution {
  margin-top: 1.6rem;
  font-size: 0.82rem;
}

/* The cursor scales with the text it follows. */
.thinking-out-loud.lead #thought::after {
  width: 0.42ch;
  height: 1.05em;
}

/* --- fitting one screen ------------------------------------------------- */
/*
 * Target: no scrolling at common desktop sizes. Deliberately NOT achieved with
 * overflow:hidden — if a visitor raises their font size or uses a short window,
 * a hard-locked viewport clips content with no way to reach it. This just makes
 * the content short enough that scrolling usually isn't needed, and degrades to
 * ordinary scrolling when it is.
 *
 * Phones still scroll, and should: seven clocks and a booking calendar cannot
 * share a phone screen at a readable size. There the priority is that the
 * entry fills the first screen.
 */

@media (min-width: 62rem) and (min-height: 34rem) {
  main {
    /* Two columns: the reading matter on the left, the utilities on the right.
       This is what removes most of the height. */
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
      "primary secondary"
      "footer  footer";
    column-gap: 3.25rem;
    align-items: start;
    /* Wider than the reading measure on purpose: the expertise details wrap
       less, which is worth more height than the extra width costs. */
    max-width: 76rem;
    padding-top: min(9vh, 4.5rem);
    padding-bottom: 2rem;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .col-primary { grid-area: primary; }
  .col-secondary { grid-area: secondary; }
  main > footer { grid-area: footer; }

  /* Sections no longer stack, so the first in each column needs no rule above
     it and the vertical rhythm tightens. */
  .col > *:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .col-primary .thinking-out-loud { margin-top: 2.5rem; padding-top: 1.5rem; }
  .col-secondary .booking { margin-top: 2.5rem; padding-top: 1.5rem; }


  .weather table { font-size: 0.82rem; }
  .weather th, .weather td { padding-top: 0.22rem; padding-bottom: 0.22rem; }

  main > footer { margin-top: 2.5rem; padding-top: 1.25rem; }
}

/* --- the calendar disclosure ------------------------------------------- */

.calendar { margin-top: 1.2rem; }

.calendar summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink-faint);
  border-radius: 2px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.calendar summary::-webkit-details-marker { display: none; }
.calendar summary:hover { background: rgba(255, 255, 255, 0.07); }
.calendar summary:focus-visible { outline: 2px solid var(--ink-dim); outline-offset: 2px; }

/* One label for closed, another for open. */
.calendar .summary-close { display: none; }
.calendar[open] .summary-open { display: none; }
.calendar[open] .summary-close { display: inline; }

.calendar .booking-embed { height: min(40rem, 70vh); }

/* In two columns the right-hand side is too narrow for the condition text, which
   wrapped raggedly ("partly / cloudy"). Drop it: the temperature is the
   information, and the landscape behind the page already shows the weather. */
@media (min-width: 62rem) and (min-height: 34rem) {
  .col-secondary .weather .desc { display: none; }
  .col-secondary .weather .temp { width: auto; padding-right: 0; }
}

/* Shorter desktop viewports (a 1280x800 laptop) were overflowing by ~64px.
   Tighten the vertical rhythm rather than cutting anything. */
@media (min-width: 62rem) and (max-height: 64rem) {
  main {
    padding-top: min(5vh, 2rem);
    padding-bottom: 1.25rem;
  }
  .col-primary .thinking-out-loud,
  .col-secondary .booking { margin-top: 1.6rem; padding-top: 1.1rem; }
  main > footer { margin-top: 1.3rem; padding-top: 0.9rem; }
  .expertise dt { margin-top: 0.65rem; }
  .expertise h1 { margin-bottom: 0.8rem; }

  #thought { min-height: 2.9em; }
  .booking-lede { margin-bottom: 1rem; }
}

/* The label lives inside #ask-form, which is a flex row — so it was being laid
   out as a flex item beside the input, squeezing it. Force it onto its own line.
   (This only became visible once ANTHROPIC_API_KEY was set and the section
   rendered for the first time.) */
#ask-form label {
  flex: 1 0 100%;
  margin-bottom: 0.55rem;
}

#ask-form input { flex: 1 1 12rem; }
#ask-form button { flex: 0 0 auto; }

/* --- booking as the page's one call to action --------------------------- */
/*
 * It sits at the top of the right column, level with the entry's first line, so
 * it's seen immediately without leading the page. Everything else here is
 * restrained by design; this is the one element allowed to be loud, which is
 * what makes it read as the actionable thing rather than more furniture.
 */

@media (min-width: 62rem) and (min-height: 34rem) {
  /* First in its column: no rule above it, and it keeps the top alignment. */
  .col-secondary .booking {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  /* The sections that follow it now carry the dividers. */
  .col-secondary .weather,
  .col-secondary .ask {
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
  }
}

.booking .label { color: var(--ink-dim); }

.booking-lede {
  font-size: 1.08rem;
  color: var(--ink);
}

/* Solid, not outlined. Two thin-bordered chips read as metadata; filled buttons
   read as the thing to press. */
.tiers a {
  padding: 0.8rem 1.15rem;
  gap: 0.75rem;
  border-color: transparent;
  background: rgba(242, 239, 233, 0.11);
  box-shadow: inset 0 0 0 1px rgba(242, 239, 233, 0.22);
}

.tiers a:hover {
  background: rgba(242, 239, 233, 0.19);
  box-shadow: inset 0 0 0 1px rgba(242, 239, 233, 0.4);
}

.tiers .duration {
  font-size: 0.76rem;
  color: var(--ink-dim);
}

.tiers .price {
  font-size: 1.08rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --- what I actually know ----------------------------------------------- */
/* Scannable, not readable start-to-finish. The term carries the claim, the
   detail earns it, and both sit tight because eight of these have to share one
   screen with everything else. */

.expertise h1 {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-dim);
}

.expertise dl { margin: 0; }

.expertise dt {
  margin-top: 0.85rem;
  font-size: 1.08rem;
  line-height: 1.3;
  color: var(--ink);
}

.expertise dt:first-of-type { margin-top: 0; }

.expertise dd {
  margin: 0.15rem 0 0;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--ink-faint);
  text-wrap: pretty;
}


/* --- mobile ------------------------------------------------------------- */
/* One column, and it scrolls — a booking section, eight expertise areas and
   seven clocks cannot share a phone screen at a readable size, and shrinking
   type until they do would be the wrong trade. What matters here instead:
   nothing overflows sideways, booking comes first, and tap targets are big
   enough. */

@media (max-width: 62rem) {
  /* Flex, not block: `order` below needs a flex container to do anything, and
     `display: contents` on the wrappers lets the sections themselves be the
     flex items so they can be reordered independently. */
  main {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.25rem 3rem;
    max-width: 34rem;
  }

  .col { display: contents; }

  /* Booking first on a phone: it is the one action on the page, and burying it
     under eight paragraphs of expertise loses it. */
  .booking { order: 1; margin-top: 0; padding-top: 0; border-top: 0; }
  .expertise { order: 2; }
  .thinking-out-loud { order: 3; }
  .weather { order: 4; }
  .ask { order: 5; }
  main > footer { order: 6; }

  .expertise, .thinking-out-loud, .weather, .ask {
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
  }

  .expertise dt { font-size: 1rem; margin-top: 1rem; }
  .expertise dd { font-size: 0.88rem; }

  /* Tap targets. 16px on the input is what stops iOS zooming the page in. */
  .tiers { width: 100%; }
  .tiers li { flex: 1 1 8rem; }
  .tiers a { padding: 0.85rem 1rem; min-height: 44px; align-items: center;
             justify-content: space-between; }
  /* Wrapping must stay on: the label is flex-basis:100% so it takes its own
     line, and the input and button then share the next one. Forcing nowrap put
     all three on one row, where the full-width label squeezed the input and
     button down to nothing — the input simply disappeared. */
  #ask-input { min-height: 44px; font-size: 16px; flex: 1 1 6rem; min-width: 0; }
  #ask-form button { min-height: 44px; flex: 0 0 auto; padding-inline: 1.15rem; }

  /* The clock table was the one thing forcing the page wider than the screen:
     every cell was nowrap, so seven rows of city + time + temperature could not
     shrink. Fixed layout lets it fit the column instead. */
  .weather table { table-layout: fixed; width: 100%; font-size: 0.72rem; }
  .weather th { width: 4.2rem; }
  .weather td { white-space: normal; overflow-wrap: anywhere; }
  .weather .clock { width: 4.6rem; }
  .weather .temp { width: 3rem; }
  .weather .desc { display: none; }
  .aside, .attribution { max-width: none; }
}

@media (max-width: 26rem) {
  main { padding: 1.75rem 1rem 2.5rem; }
  .weather th { display: none; }
  .weather table { font-size: 0.7rem; }
}

/* Belt and braces: nothing on this page should ever scroll sideways. If some
   future element overflows, clip it rather than shipping a horizontal
   scrollbar on a phone. */
html, body { overflow-x: hidden; }

/* Shorter laptops again (1280x800 and similar). The expertise list is the
   tallest thing on the page, so this trims its leading rather than cutting
   entries — the content survives, the whitespace gives. */
@media (min-width: 62rem) and (max-height: 51rem) {
  main { padding-top: min(3vh, 1.1rem); padding-bottom: 0.7rem; }
  .expertise h1 { margin-bottom: 0.65rem; font-size: 0.98rem; }
  .expertise dt { margin-top: 0.55rem; font-size: 1.02rem; }
  .expertise dd { font-size: 0.87rem; line-height: 1.36; }
  #thought { min-height: 2.5em; font-size: 1.06rem; }
  .attribution { margin-top: 0.7rem; }
  .booking-lede { margin-bottom: 0.85rem; }
  .aside { margin-top: 0.85rem; }
  .col-secondary .weather,
  .col-secondary .ask { margin-top: 1.5rem; padding-top: 1.1rem; }
  .col-primary .thinking-out-loud { margin-top: 1.5rem; padding-top: 1.1rem; }
  main > footer { margin-top: 0.9rem; padding-top: 0.7rem; font-size: 0.86rem; }
}

/* --- ask openers -------------------------------------------------------- */
/* Chips sit between the input and the note. Deliberately quiet: they are a
   hint about what the box can answer, not a call to action competing with
   booking. */
.ask-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.ask-chip {
  padding: 0.28rem 0.6rem;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: pointer;
}

.ask-chip:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
  background: rgba(255, 255, 255, 0.05);
}

.ask-chip:focus-visible {
  outline: 2px solid var(--ink-dim);
  outline-offset: 2px;
}
