@import "_fonts.css";

:root {
  color-scheme: light;
  --ink: #1f1f24;
  --muted: #5c5c6a;
  --paper: #f7f2ea;
  --paper-2: #ffffff;
  --accent: #b7562b;
  --accent-2: #1d6b7a;
  --border: #ded7cc;
  --shadow: 0 20px 60px rgba(20, 18, 14, 0.12);
  --radius: 20px;
  --font-sans: "Vulf Sans", ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: "Vulf Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: transform 0.2s ease;
  z-index: 999;
}

.skip-link:focus {
  transform: translateY(4rem);
}

.container {
  max-width: 2000px;
  margin: 0 auto;
}

.site-main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding-bottom: 4rem;
}

.padded {
  padding-left: 2rem;
  padding-right: 2rem;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  display: block;
}

.hero h1.fit-text {
  line-height: 1;
}

.hero h1.fit-text svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.hero h1.fit-text svg text {
  fill: currentColor;
  font-family: inherit;
  font-weight: inherit;
}

.lede {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.section {
  padding: 2rem 0 4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.inline-link {
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.post-card h3 {
  font-family: var(--font-serif);
  line-height: 1;
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.post-card p {
  margin: 0;
  color: var(--muted);
}

.post-link {
  align-self: flex-start;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
}

.post {
  /* width: min(760px, 92vw);
  margin: 0 auto; */
}

.post-header {
  margin: 4rem 0;
}

.post-header h1 {
  font-family: var(--font-sans);
  font-weight: bold;
  font-size: clamp(6rem, 4vw, 3rem);
  line-height: 0.9;
  margin: 0 2rem 1rem 2rem;
}

.post-meta {
  margin: 4rem 2rem 2rem 2rem;
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.8rem;
}

.post-content {
  max-width: 65ch;
  margin-left: max(0px, min(35%, calc(100% - 65ch)));
}

.post-content .prose {
  margin: 0 2rem;
}

.prose {
  font-size: 0.8rem;
  font-weight: light;
  font-family: var(--font-mono);
}

.prose h2,
.prose h3 {
  font-family: var(--font-sans);
  font-weight: bold;
  margin-top: 2.5rem;
}

.prose h2 {
  font-size: 2rem;
  margin: 2rem 0;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  font-family: var(--font-mono);
  font-style: italic;
  font-weight: 100;
  font-size: 1.1rem;
}

.prose figure {
  margin: 1.5rem 0;
  padding-left: 0;
  padding-right: 0;
}

.prose figcaption {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.8rem;
}

.prose table {
  margin: 3rem 0;
  border-collapse: collapse;
}

.prose table th {
  font-style: italic;
  text-align: left;
  padding: 0.25rem 0.5rem;
}

.prose table td {
  border-top: 1px solid;
  margin: 0;
  padding: 0.25rem 0.5rem;
}

.prose hr {
  height: 0;
  border: none;
  border-top: 1px dotted;
  margin: 3rem 0;
}

.prose code:not(pre code) {
  display: inline-block;
  /* border: 1px solid; */
  padding: 0 0.375rem;
  /* border-radius: 0.25rem; */
  background: repeating-linear-gradient(
    45deg,
    white,
    white 1px,
    #e6e6e6 1px,
    #e6e6e6 2px
  );
}

pre,
code {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.prose pre:has(code) {
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: scroll;
}

.site-footer {
  width: 100%
}

.footer-links {
  display: flex;
  list-style: none;
  font-family: var(--font-mono);
  font-style: italic;
  gap: 1rem;
  font-size: 0.8rem;
  padding: 2rem;
}

@media (max-width: 720px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Mileage / Century Club */

.mileage-milestones {
  margin: 4rem 0;
}

.milestone {
  margin: 0.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.milestone.achieved {
  border-top: 1px dotted;
  border-bottom: 1px dotted;
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  line-height: 1.1;
}

.milestone-date {
  font-style: italic;
}

.milestone.next {
  font-weight: 600;
  margin-top: 2rem;
}

.mileage-progress {
  margin: 0.5rem 0 2rem;
}

.progress-bar {
  height: 12px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0.5rem 0 0;
  font-style: italic;
}

.mileage-chart {
  margin: 2.5rem 0;
}

.mileage-chart h3 {
  font-size: 1rem;
  margin: 0 0 1rem;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.chart-value {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.chart-fill {
  width: 100%;
  background: var(--accent);
  min-height: 0;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 6px;
}

.mileage-updated {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2rem;
}

/* Guestbook */

.guestbook-entry {
  margin: 1.5rem 0;
}

.guestbook-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-weight: 600;
}

.guestbook-entry-date {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
}

.guestbook-entry-message {
  margin: 0.25rem 0 0;
}

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 28rem;
}

.guestbook-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.guestbook-field label {
  font-weight: 600;
  font-size: 0.85rem;
}

.guestbook-field-note {
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
}

.guestbook-field .required {
  color: var(--accent);
}

.guestbook-field input,
.guestbook-field textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 4px;
}

.guestbook-field input:focus,
.guestbook-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.guestbook-form button[type="submit"] {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1.5rem;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.guestbook-form button[type="submit"]:hover {
  opacity: 0.85;
}

.guestbook-form button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.guestbook-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.75rem;
  border-radius: 4px;
}

.guestbook-status.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.guestbook-status.error {
  background: #fbe9e7;
  color: #c62828;
}
