@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Instrument+Sans:wght@400;500&display=swap");

:root {
  --bg: #f8f4ee;
  --text: #16120f;
  --muted: #6f655c;
  --line: rgba(22, 18, 15, 0.14);
  --line-strong: rgba(22, 18, 15, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  background: #eee5d8;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(171, 128, 93, 0.08), transparent 28%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

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

.page {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 30px 0 72px;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 28px;
  align-items: start;
}

.brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 0.88;
  text-decoration: none;
}

.header-aside {
  display: grid;
  gap: 16px;
  justify-items: end;
}

.nav,
.social-links,
.home-links,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.nav,
.social-links {
  justify-content: flex-end;
}

.nav a,
.social-links a,
.home-links a,
.inline-links a,
.inline-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.nav a,
.home-links a {
  position: relative;
  padding-bottom: 4px;
}

.nav a::after,
.home-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav a.active,
.social-links a:hover,
.social-links a:focus-visible,
.home-links a:hover,
.home-links a:focus-visible,
.inline-links a:hover,
.inline-links a:focus-visible,
.inline-link:hover,
.inline-link:focus-visible {
  color: var(--text);
  outline: none;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.active::after,
.home-links a:hover::after,
.home-links a:focus-visible::after {
  transform: scaleX(1);
}

.social-links,
.inline-links {
  font-size: 0.9rem;
}

.home-main {
  padding-top: 42px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.home-tile {
  display: block;
  grid-column: span 3;
  overflow: hidden;
  background: #d5c9bc;
  text-decoration: none;
}

.home-tile img {
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.home-tile:hover img,
.home-tile:focus-visible img {
  transform: scale(1.02);
  filter: contrast(1.04);
}

.home-links {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.home-links li {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3.6rem, 8vw, 6.5rem);
  line-height: 0.86;
}

h2 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 0.92;
}

h3 {
  font-size: 1.5rem;
  line-height: 1;
}

.page-main {
  max-width: 980px;
  padding-top: 60px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 42px;
  align-items: start;
}

.lead {
  max-width: 38rem;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.aside-note {
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.portrait {
  margin-top: 44px;
}

.portrait img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 48px;
  margin-top: 44px;
}

.prose,
.post-list,
.detail-list,
.python-shell {
  border-top: 1px solid var(--line-strong);
  padding-top: 22px;
}

.prose p,
.post-copy,
.detail-copy,
.python-status,
.footer-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.detail-list,
.post-list {
  display: grid;
  gap: 22px;
}

.detail-item,
.post {
  padding-top: 4px;
}

.detail-label,
.post-date,
.section-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.detail-title,
.post-title {
  margin: 0 0 8px;
}

.python-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.python-panel {
  display: grid;
  gap: 14px;
}

.python-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.python-editor,
.python-output {
  width: 100%;
  min-height: 320px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
  line-height: 1.66;
}

.python-editor {
  resize: vertical;
}

.python-output {
  overflow: auto;
  white-space: pre-wrap;
}

.button-row,
.python-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.button:hover,
.button:focus-visible,
.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.45);
  outline: none;
}

.python-status.error {
  color: #8a2f1c;
}

.footer-note {
  margin-top: 26px;
}

@media (max-width: 900px) {
  .site-header,
  .intro-grid,
  .body-grid,
  .python-layout {
    grid-template-columns: 1fr;
  }

  .header-aside {
    justify-items: start;
  }

  .nav,
  .social-links {
    justify-content: flex-start;
  }

  .home-tile {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .page-main {
    padding-top: 40px;
  }

  .home-main {
    padding-top: 30px;
  }

  .home-grid {
    gap: 16px;
  }

  .home-tile img {
    min-height: 170px;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }
}
