:root {
  --color-bg: #f5f1e8;
  --color-surface: rgba(255, 252, 247, 0.9);
  --color-border: rgba(56, 49, 45, 0.12);
  --color-text: #403735;
  --color-muted: #6e645d;
  --color-strong: #2f2927;
  --color-accent: #c75f57;
  --color-accent-soft: #ecd2cd;
  --shadow-soft: 0 18px 40px rgba(44, 33, 26, 0.08);
  --radius-card: 22px;
  --radius-pill: 999px;
  --site-width: min(1120px, calc(100vw - 2rem));
  --reading-width: min(760px, calc(100vw - 2rem));
  --font-ui: "Source Sans 3", "Segoe UI", sans-serif;
  --font-prose: "Source Serif 4", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(199, 95, 87, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(109, 130, 125, 0.16), transparent 28%),
    linear-gradient(180deg, #f7f3eb 0%, #f2eee6 46%, #efebe4 100%);
  color: var(--color-text);
  font-family: var(--font-ui);
  line-height: 1.65;
}

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

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration: none;
}

p,
ul,
ol,
dl,
table,
blockquote,
pre {
  margin: 0 0 1.1rem;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--color-strong);
  line-height: 1.1;
}

figure {
  margin: 0;
}

.site-width {
  width: var(--site-width);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-200%);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--color-strong);
  color: #fff;
}

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

.wrapper {
  padding: 0 0 4rem;
}

.site-header-shell {
  padding: 2rem 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--color-strong);
}

.site-logo--home {
  align-items: center;
}

.site-logo__text {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.2rem 0;
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

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

.site-nav a:hover::after,
.site-nav a:focus-visible::after,
.site-nav .current_page_item a::after {
  transform: scaleX(1);
}

.site-nav .current_page_item a {
  color: var(--color-strong);
}

#banner-wrapper,
.legacy-page-card,
.legacy-project-card,
.writing-shell > .site-width,
.site-footer-shell .site-width {
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

#banner-wrapper {
  width: var(--site-width);
  margin: 0 auto 1.5rem;
  padding: 3.5rem clamp(1.4rem, 4vw, 3rem);
}

#banner {
  max-width: 48rem;
}

#banner h2 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: none;
  margin-bottom: 1.25rem;
}

#banner p {
  font-size: 1.08rem;
  color: var(--color-muted);
}

#banner a {
  color: var(--color-accent);
}

#portfolio-preview,
#content,
#sidebar,
#portfolio {
  margin: 0;
}

#portfolio {
  padding: 0;
  list-style: none;
}

#portfolio > li {
  list-style: none;
}

.homepage #portfolio-preview,
.no-sidebar #content,
.right-sidebar .wrapper > .row,
.writing-shell > .site-width {
  width: var(--site-width);
  margin: 0 auto;
}

.homepage #portfolio-preview,
.no-sidebar #content,
.writing-shell > .site-width,
.site-footer-shell .site-width {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

#portfolio-preview > header,
#content > header,
.page-intro {
  margin-bottom: 1.75rem;
}

#portfolio-preview h2,
#content > header h2,
#content article > header h2,
.page-intro h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: none;
}

#portfolio-preview .byline,
#content > header .byline,
#content article > header .byline,
.lead,
.eyebrow,
.writing-list__meta,
#banner .byline {
  color: var(--color-muted);
}

#portfolio-preview .byline,
#content > header .byline,
#content article > header .byline,
.lead {
  display: block;
  margin-top: 0.65rem;
  font-size: 1.05rem;
}

.eyebrow,
.writing-list__meta {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row {
  display: grid;
  gap: 1.25rem;
}

#portfolio-preview .row,
#portfolio .row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.right-sidebar .row {
  grid-template-columns: minmax(0, 1.9fr) minmax(260px, 0.95fr);
  align-items: start;
}

.4u,
.8u {
  width: auto;
  margin: 0;
}

.image {
  display: block;
  border-radius: 1rem;
}

.image img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
}

.image.fit {
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 12px 24px rgba(47, 41, 39, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image.fit:hover,
.image.fit:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(47, 41, 39, 0.16);
}

.no-sidebar .wrapper,
.right-sidebar .wrapper {
  padding-bottom: 3rem;
}

.no-sidebar #content,
.right-sidebar #content,
.right-sidebar #sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.no-sidebar #content,
.right-sidebar #content {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.right-sidebar #sidebar {
  padding: 1.5rem;
}

.right-sidebar #content article,
.no-sidebar #content {
  font-family: var(--font-prose);
  font-size: 1.14rem;
  line-height: 1.85;
}

.right-sidebar #content article > header,
.no-sidebar #content > header {
  font-family: var(--font-ui);
  margin-bottom: 2rem;
}

.right-sidebar #content article > .image.image-full {
  display: block;
  margin-bottom: 1.8rem;
}

.right-sidebar #content p,
.no-sidebar #content p {
  color: var(--color-text);
}

.right-sidebar #content a,
.no-sidebar #content a,
.prose-body a,
.writing-list a {
  color: var(--color-accent);
}

.right-sidebar #content h3,
.no-sidebar #content h3,
.prose-body h2,
.prose-body h3,
.prose-body h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  margin: 2rem 0 0.85rem;
}

.right-sidebar #sidebar h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  margin-bottom: 0.5rem;
}

.right-sidebar #sidebar section > header {
  margin-bottom: 1rem;
}

.right-sidebar #sidebar section > header + ul.style1 {
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: #b7534d;
}

ul.style1 {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.style1 li {
  margin: 0;
  padding: 0.9rem 0;
  border-top: 1px solid var(--color-border);
}

ul.style1 li:first-child {
  border-top: 0;
  padding-top: 0;
}

ul.style1 a {
  color: var(--color-strong);
  text-decoration: none;
}

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

.writing-shell {
  padding-bottom: 3rem;
}

.writing-shell > .site-width {
  padding: clamp(1.75rem, 4vw, 3rem);
}

.prose-article {
  width: var(--reading-width);
  margin: 0 auto;
}

.page-intro--writing {
  max-width: 42rem;
}

.page-intro--entry {
  margin-bottom: 2.2rem;
}

.prose-body {
  font-family: var(--font-prose);
  font-size: 1.18rem;
  line-height: 1.9;
}

.prose-body > :last-child {
  margin-bottom: 0;
}

.prose-body blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--color-accent-soft);
  color: var(--color-muted);
}

.prose-body pre,
.prose-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prose-body code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(47, 41, 39, 0.08);
  font-size: 0.9em;
}

.prose-body pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: #201c1b;
  color: #f4efec;
}

.prose-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.writing-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.writing-list__item {
  padding: 1.4rem 0;
  border-top: 1px solid var(--color-border);
}

.writing-list__item:first-child {
  padding-top: 0;
  border-top: 0;
}

.writing-list__item h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.25rem 0 0.6rem;
}

.empty-state {
  margin: 0;
  color: var(--color-muted);
}

.site-footer-shell {
  padding-bottom: 2rem;
}

.site-footer-shell .site-width {
  padding: clamp(1.5rem, 4vw, 2.2rem);
}

.site-footer header {
  margin-bottom: 1rem;
}

.site-footer h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-strong);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.contact a:hover,
.contact a:focus-visible {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
}

.icon::before {
  display: inline-block;
  font-family: FontAwesome;
  font-size: 1.1rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

#copyright {
  margin-top: 1.25rem;
  color: var(--color-muted);
}

#copyright a {
  color: var(--color-accent);
}

@media (max-width: 960px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav ul {
    justify-content: flex-start;
  }

  #portfolio-preview .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .right-sidebar .row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-width,
  .writing-shell > .site-width,
  .prose-article,
  #banner-wrapper,
  .homepage #portfolio-preview,
  .no-sidebar #content,
  .right-sidebar .wrapper > .row,
  .site-footer-shell .site-width {
    width: min(100vw - 1rem, var(--site-width));
  }

  .wrapper {
    padding-bottom: 1rem;
  }

  .site-header-shell {
    padding-bottom: 1.25rem;
  }

  #banner-wrapper,
  .homepage #portfolio-preview,
  .no-sidebar #content,
  .right-sidebar #content,
  .right-sidebar #sidebar,
  .writing-shell > .site-width,
  .site-footer-shell .site-width {
    border-radius: 1.25rem;
  }

  #portfolio-preview .row {
    grid-template-columns: 1fr;
  }

  .site-nav a,
  .button {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav ul,
  .contact {
    width: 100%;
  }

  .contact a {
    width: 2.9rem;
    justify-content: center;
  }
}
