@import url("https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400&family=Lato:wght@400;700;900&family=Nunito:wght@400;600;700&display=swap");

/* ===== Base ===== */
:root {
  --page-max-width: 860px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: #2563eb;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.header-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-family: "Fira Sans", sans-serif;
  font-size: 29px;
  font-style: normal;
  font-weight: 400;
  color: #1a1a1a;
}
.site-title:hover { text-decoration: none; color: #2563eb; }

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.site-header nav a {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover {
  color: #1e40af;
  text-decoration: none;
}
.site-header nav a.nav-current {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* ===== Main content ===== */
main {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

h1 { font-size: 1.75rem; margin-top: 0; margin-bottom: 1rem; line-height: 1.3; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
p { margin-top: 0; margin-bottom: 1rem; }
article h1 { margin-bottom: 0.5rem; }
article .meta, article time { font-size: 0.9375rem; color: #64748b; margin-bottom: 1rem; display: block; }

/* ===== Footer ===== */
footer {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  margin-top: 0;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9375rem;
  color: #64748b;
}
footer p {
  margin-bottom: 0.35rem;
}
footer p:last-child {
  margin-bottom: 0;
}
footer a { color: #475569; }
.footer-note {
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: right;
  color: #94a3b8;
}

/* ===== Homepage ===== */
.intro { font-size: 1.125rem; margin-bottom: 1.5rem; color: #334155; }
.cta { margin: 1.75rem 0; }
.cta-link {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  background: #2563eb;
  color: #fff;
  border-radius: 6px;
}
.cta-link:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.thoughts-list { margin-top: 2rem; }
.thoughts-list h2 { margin-bottom: 0.75rem; }
.thought-card {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 1.5rem 0;
  border-top: 1px solid #e2e8f0;
}
.thought-card-content p {
  font-family: "Nunito", sans-serif;
  font-size: 18px;
}
.thought-card-content h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}
.thought-card-content p:last-child,
.thought-card-meta p:last-child {
  margin-bottom: 0;
}
.thought-card-meta h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.thought-card-meta {
  padding-left: 1.5rem;
  border-left: 1px solid #e2e8f0;
}
.thought-card-meta h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  line-height: 1.3;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-weight: 700;
  color: #0f172a;
}
.thought-card-meta h3 a { color: #2563eb; }
.thought-card-meta h3 a:hover { text-decoration: none; color: #1d4ed8; }
.thought-card-summary {
  font-size: 0.7rem;
  line-height: 1.6;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: #475569;
}
.thought-card-meta time {
  color: #64748b;
  font-size: 0.9375rem;
  font-weight: 400;
}

/* ===== Shared page surfaces ===== */
.page-soft {
  background:
    radial-gradient(circle at top, rgba(191, 219, 254, 0.35), transparent 36%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 30%);
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: #0f172a;
}

.page-shell {
  max-width: 860px;
  padding-top: 3rem;
}



.surface-card {
  padding: 1.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.surface-card-accent {
  border-color: #bfdbfe;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.96));
}

.prose-card {
  padding-top: 0;
}

.prose-card p,
.prose-card li {
  font-family: "Nunito", sans-serif;
  font-size: 18px;
}



.prose-card h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  line-height: 1.3;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-weight: 700;
  color: #0f172a;
}

.prose-card h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}


.prose-card p:last-child,
.prose-card ul:last-child {
  margin-bottom: 0;
}

.prose-card ul {
  margin: 1rem 0 1.25rem;
  padding-left: 1.25rem;
}

.prose-card li + li {
  margin-top: 0.5rem;
}

.page-banner {
  margin: 0 -1.75rem 1.5rem;
}

.page-banner img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom: 1px solid #bfdbfe;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.page-soft footer {
  max-width: 860px;
  border-top: none;
  color: #64748b;
}

/* ===== Timeline page: full-width iframe embed ===== */
body.timeline-page {
  height: 100vh;
  min-height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main.timeline-wrapper {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex: 1 0 auto;
  min-height: 0;
}

body.timeline-page footer {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem 1rem;
}

body.timeline-page .footer-note {
  font-size: 0.6875rem;
  line-height: 1.3;
}

.timeline-embed {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  display: block;
}

.comments-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}
.comments-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: #333;
}
.comments-thread {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 1em;
}
.comments-thread:not(:empty) { padding-bottom: 0.25rem; }

.comment {
  margin-bottom: 1.15rem;
  padding: 0.9rem 0 0.5rem;
  border-bottom: 1px solid #eee;
  background: transparent;
}
.comment:last-child { border-bottom: none; }
.comment-replies {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid #ddd;
}
.comment-replies .comment { margin-bottom: 1rem; padding-top: 0.65rem; }

.comment-header {
  margin-bottom: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.comment-author,
.comment-date,
.comment-reply-btn,
.comment-form label,
.toolbar-btn,
.comment-form button[type="submit"],
.comment-reply-inline .comment-form button[type="button"].cancel-btn {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}
.comment-author {
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  color: #2563eb;
}
.comment-date {
  font-size: 0.875rem;
  color: #999;
}
.comment-body {
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 18px;
  line-height: 1.65;
  color: #444;
}
.comment-body a {
  color: #2563eb;
  text-decoration: none;
}
.comment-body a:hover { text-decoration: underline; }
.comment-body strong { font-weight: 700; }
.comment-body em { font-style: italic; }

.comment-reply-btn {
  font-size: 0.875rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  text-decoration: none;
}
.comment-reply-btn.is-active,
.comment-reply-btn:hover { color: #333; text-decoration: underline; }

/* Main comment form */
.comments-section > div > .comment-form {
  margin-bottom: 1rem;
  padding: 0;
  border-top: none;
}
.comment-form label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #555;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea,
.comment-form .comment-editor {
  width: 100%;
  max-width: 480px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  background: #fff;
  transition: border-color 0.15s ease;
}
.comment-body,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea,
.comment-form .comment-editor,
.comment-form .comment-editor:empty::before {
  font-family: "Nunito", sans-serif;
}
.comment-form .comment-editor {
  min-height: 7.5rem; /* ~5 lines */
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-form .comment-editor:empty::before {
  content: attr(data-placeholder);
  color: #999;
}
.comment-form .comment-editor:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 1px #eee;
}
.comment-form input[type="email"] { max-width: 280px; }
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 1px #eee;
}
.comment-form p { margin-bottom: 0.75rem; }
.comment-form p:last-of-type { margin-bottom: 0.5rem; }
.comment-form-main .comment-composer {
  border: 1px solid #d9dee5;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.comment-form-main .comment-editor {
  max-width: none;
  min-height: 8rem;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 0;
}
.comment-form-main .comment-editor:focus {
  box-shadow: none;
  border-color: transparent;
}
.comment-form-main .comment-form-toolbar {
  display: flex;
  width: 100%;
  margin-bottom: 0;
  border: none;
  border-top: 1px solid #e5e7eb;
  border-radius: 0;
  background: #f8fafc;
  padding: 0.35rem 0.5rem;
}
.comment-form-main .comment-form-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.2rem);
  transition: max-height 0.2s ease, opacity 0.18s ease, margin-top 0.2s ease, transform 0.2s ease;
}
.comment-form-main:focus-within .comment-form-footer {
  margin-top: 0.875rem;
  max-height: 12rem;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.comment-form-main .comment-form-fields {
  flex: 1;
  max-width: none;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.comment-form-main .comment-form-fields p {
  margin-bottom: 0;
  flex: 1 1 0;
}
.comment-form-main input[type="text"],
.comment-form-main input[type="email"] {
  max-width: none;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.875rem;
  color: #334155;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.comment-form-main input[type="text"]::placeholder,
.comment-form-main input[type="email"]::placeholder {
  color: #64748b;
}
.comment-form-main input[type="text"]:focus,
.comment-form-main input[type="email"]:focus {
  border-color: #94a3b8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}
.comment-form-main .comment-form-actions {
  margin-top: 0;
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  gap: 0.5rem;
}
.comment-form-main button[type="submit"] {
  min-width: 170px;
  padding: 0.8rem 1.35rem;
  border-radius: 4px;
  background: #14b8a6;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comment-form-main button[type="submit"]:hover { background: #0f9f90; }
.reply-notice {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0;
}

/* Formatting toolbar above textarea */
.comment-form-toolbar {
  display: inline-flex;
  gap: 0;
  margin-bottom: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px 4px 0 0;
  border-bottom: none;
  background: #f7f7f7;
  padding: 2px 4px;
}
.toolbar-btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.5rem;
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: #555;
  min-width: 2rem;
}
.toolbar-btn:hover { background: #e8e8e8; color: #333; }
.comment-form p:has(.comment-form-toolbar) label { margin-bottom: 0.4rem; }
.comment-form p:has(.comment-form-toolbar) .comment-editor,
.comment-form p:has(.comment-form-toolbar) textarea {
  border-radius: 0 0 4px 4px;
  margin-top: 0;
}

/* Submit / Cancel buttons */
.comment-form-actions { margin-top: 1rem; }
.comment-form button[type="submit"] {
  padding: 0.5rem 1.125rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.comment-form button[type="submit"]:hover { background: #555; }
.comment-form button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

/* Inline reply form (slide-down under a comment) */
.comment-reply-inline {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease-out;
}
.comment.reply-active > .comment-body {
  color: #334155;
}
.comment-reply-inline.open { max-height: 640px; }
.comment-reply-inline .comment-form-reply {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}
.comment-reply-inline .comment-form input[type="text"],
.comment-reply-inline .comment-form input[type="email"],
.comment-reply-inline .comment-form .comment-editor { max-width: 100%; }
.comment-reply-inline .comment-form button[type="button"].cancel-btn {
  background: #fff;
  color: #666;
  border: 1px solid #ccc;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.comment-reply-inline .comment-form button[type="button"].cancel-btn:hover {
  background: #f0f0f0;
  color: #333;
  border-color: #999;
}
.comment-reply-inline .comment-form button[type="submit"] { margin-top: 0; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-inner { padding: 0.75rem 1rem; }
  main { padding: 1.5rem 1rem 2rem; }
  footer { padding: 1rem; }
  .thought-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .comment-replies { margin-left: 0.5rem; padding-left: 0.75rem; }
  .comment-form input[type="email"] { max-width: 100%; }
  .comment-form-main .comment-form-footer {
    flex-direction: column;
  }
  .comment-form-main .comment-form-fields {
    max-width: none;
    width: 100%;
  }
  .comment-form-main .comment-form-actions {
    width: 100%;
    align-self: stretch;
  }
  .comment-form-main .comment-form-actions .cancel-btn {
    flex: 0 0 auto;
  }
  .comment-form-main button[type="submit"] {
    width: 100%;
    min-width: 0;
  }
  .comment-reply-inline .comment-form { margin-left: 0; margin-right: 0; padding: 0.75rem 0.5rem; }
  .page-shell { padding-top: 2rem; }
  .surface-card { padding: 1.25rem; border-radius: 16px; }
  .page-banner {
    margin: 0 -1.25rem 1.25rem;
  }
  .page-banner img {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
  }
}
