/* ============================================================
   Matteo Godi — personal site
   Faithful static rebuild of the original (TanStack/Tailwind) site.
   No build step, no dependencies. Edit freely.
   ============================================================ */

:root {
  --radius: 0.375rem;

  /* Warm off-white paper, deep ink */
  --background: oklch(0.985 0.005 85);
  --foreground: oklch(0.18 0.01 60);
  --muted-foreground: oklch(0.45 0.01 60);
  --accent: oklch(0.42 0.12 30);
  --border: oklch(0.88 0.008 70);
  --rule: oklch(0.82 0.008 70);

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;

  /* layout */
  --maxw: 72rem;          /* max-w-6xl */
}

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

html { font-family: var(--font-sans); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

/* ---------- shell ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { max-width: var(--maxw); margin-inline: auto; width: 100%; }

/* ---------- header ---------- */
.site-header { padding: 2rem 1.5rem 1.5rem; }
.site-header .wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.brand {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.875rem;          /* text-3xl */
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--foreground);
  transition: color 0.2s ease;
}
.brand:hover { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav a {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--foreground); }

/* ---------- main / footer ---------- */
.site-main { flex: 1; padding: 0 1.5rem 4rem; }
.site-footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--rule);
}
.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.site-footer p { margin: 0; }

/* ---------- home ---------- */
.hero-img {
  width: 100%;
  height: 42vh;
  object-fit: cover;
}
.hero-lede {
  margin-top: 2.5rem;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;            /* text-2xl */
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 64rem;            /* max-w-5xl */
}
.hero-lede a {
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s ease;
}
.hero-lede a:hover { opacity: 0.7; }

/* ---------- about ---------- */
.about-grid {
  padding-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
.about-aside { display: flex; flex-direction: column; gap: 1rem; }
.about-photo {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--rule);
}
.about-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-foreground);
}
.about-links a { text-decoration: none; transition: color 0.2s ease; }
.about-links a:hover { color: var(--foreground); }

.about-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.7;
  color: color-mix(in oklch, var(--foreground) 90%, transparent);
}
.about-body p { margin: 0; }
.about-body strong { font-weight: 600; }

/* ---------- page headings ---------- */
.page-title {
  font-size: 2.25rem;          /* text-4xl */
  padding-top: 1rem;
  margin-bottom: 3rem;
}

/* ---------- writing ---------- */
.writing { max-width: 48rem; }   /* max-w-3xl */
.section { margin-bottom: 3.5rem; }
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
}
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 0; }
.entry-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;          /* text-xl */
  line-height: 1.375;
  color: var(--foreground);
  margin: 0;
}
.entry-title a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}
.entry-title a:hover { text-decoration-color: var(--foreground); }
.entry-cite { color: color-mix(in oklch, var(--foreground) 70%, transparent); }

.notes {
  list-style: none;
  margin: 0.75rem 0 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}
.notes li { position: relative; }
.notes li::before {
  content: "—";
  position: absolute;
  left: -1rem;
  color: color-mix(in oklch, var(--muted-foreground) 60%, transparent);
}
.notes a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.notes a:hover { color: var(--foreground); text-decoration-color: var(--foreground); }

/* ---------- contact ---------- */
.contact { max-width: 42rem; padding-top: 1rem; }
.contact .page-title { margin-bottom: 2.5rem; }
.contact dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.5;
}
.contact dt {
  font-family: var(--font-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}
.contact dd { margin: 0; color: color-mix(in oklch, var(--foreground) 90%, transparent); }
.contact dd a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.contact dd a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ============================================================
   Responsive — md (768px) and up
   ============================================================ */
@media (min-width: 768px) {
  .site-header,
  .site-main,
  .site-footer { padding-left: 3rem; padding-right: 3rem; }

  .site-header .wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brand { font-size: 2.25rem; }          /* md:text-4xl */
  .nav { gap: 2.25rem; }

  .site-footer .wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-img { height: 58vh; }
  .hero-lede { margin-top: 3.5rem; font-size: 2.1rem; }

  .page-title { font-size: 3rem; }         /* md:text-5xl */
  .entry-title { font-size: 1.4rem; }
}

@media (min-width: 640px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 3rem;
  }
}

@media (min-width: 1024px) {
  .site-header,
  .site-main,
  .site-footer { padding-left: 4rem; padding-right: 4rem; }
  .about-grid { gap: 4rem; }
}
