:root {
  --bg: #f7f2e8;
  --surface: #fffdf7;
  --surface-strong: #fff9ef;
  --ink: #15202b;
  --muted: #415164;
  --line: #d7cfbe;
  --accent: #d55b1d;
  --accent-2: #0d8f87;
  --accent-3: #e4b949;
  --focus: #0b6df2;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 14px 28px rgba(20, 32, 43, 0.12);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(13, 143, 135, 0.15), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(213, 91, 29, 0.18), transparent 32%),
    linear-gradient(180deg, #f7f2e8 0%, #f2f6f1 45%, #f8f3eb 100%);
  font-family: "Work Sans", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

.protocol-warning {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 0.7rem 0.9rem;
  background: #fff3cd;
  color: #533f03;
  border-bottom: 1px solid #ebcc7e;
  font-size: 0.92rem;
}

.protocol-warning code {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.88em;
}

.protocol-warning a {
  color: inherit;
  font-weight: 600;
}

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

a {
  color: inherit;
}

.container {
  width: min(var(--max-width), calc(100% - 2.6rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(21, 32, 43, 0.08);
  background: rgba(247, 242, 232, 0.9);
  backdrop-filter: blur(10px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 700;
  text-decoration: none;
}

.brand-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(21, 32, 43, 0.16);
  box-shadow: 0 6px 14px rgba(21, 32, 43, 0.18);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav a {
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(13, 143, 135, 0.12);
  border-color: rgba(13, 143, 135, 0.42);
  outline: none;
}

.link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
  border: 1px solid rgba(21, 32, 43, 0.22);
  color: #1c3d58;
  background: rgba(13, 143, 135, 0.12);
}

.link-label {
  line-height: 1.2;
}

.link-kind-external .link-icon {
  color: #0f5f57;
  background: rgba(13, 143, 135, 0.16);
}

.link-kind-internal .link-icon {
  color: #7f390f;
  background: rgba(213, 91, 29, 0.16);
}

.link-kind-mail .link-icon {
  color: #6d4a00;
  background: rgba(228, 185, 73, 0.2);
}

.link-kind-anchor .link-icon {
  color: #33465a;
  background: rgba(65, 81, 100, 0.14);
}

.site-nav a .link-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex-basis: 0.9rem;
  font-size: 0.56rem;
  border-color: rgba(21, 32, 43, 0.18);
}

.site-nav .nav-blog .link-icon {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.site-nav .nav-current {
  background: rgba(13, 143, 135, 0.18);
  border-color: rgba(13, 143, 135, 0.42);
}

.site-nav .nav-blog {
  background: var(--ink);
  color: #fff;
}

.site-nav .nav-blog:hover,
.site-nav .nav-blog:focus-visible {
  border-color: var(--ink);
  background: #243342;
}

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

.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 2vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: clamp(18px, 2vw, 24px);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 249, 236, 0.95));
  box-shadow: var(--shadow);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr minmax(220px, 0.75fr);
  gap: clamp(0.9rem, 1.8vw, 1.6rem);
  align-items: center;
}

.hero-main {
  min-width: 0;
}

.hero-side {
  display: flex;
  justify-content: flex-end;
  justify-self: end;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
}

.hero-portrait-frame {
  width: clamp(190px, 26vw, 310px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(21, 32, 43, 0.2);
  box-shadow: 0 12px 28px rgba(21, 32, 43, 0.22);
  background: rgba(255, 255, 255, 0.65);
}

.hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-card::before {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -85px;
  top: -85px;
  background: radial-gradient(circle, rgba(13, 143, 135, 0.34), transparent 68%);
}

.hero-card::after {
  width: 260px;
  height: 180px;
  left: -110px;
  bottom: -95px;
  background: radial-gradient(circle, rgba(213, 91, 29, 0.28), transparent 72%);
}

.kicker {
  margin: 0;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Fraunces", "Georgia", serif;
  line-height: 1.2;
}

.hero h1 {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  max-width: 18ch;
}

.hero .subtitle {
  margin-top: 0.95rem;
  color: var(--muted);
  max-width: 66ch;
}

.hero .intro {
  margin-top: 0.9rem;
  max-width: 66ch;
}

.hero-meta {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-actions {
  margin-top: 1.35rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 0.62rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  box-shadow: 0 12px 20px rgba(21, 32, 43, 0.2);
}

.btn-ghost {
  border-color: rgba(21, 32, 43, 0.25);
  background: rgba(255, 255, 255, 0.72);
}

.chip-list {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.82rem;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.chip-placeholder {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.75rem;
  border: 1px dashed rgba(21, 32, 43, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  color: var(--muted);
}

.chip-list a:hover,
.chip-list a:focus-visible {
  border-color: var(--accent-2);
  background: rgba(13, 143, 135, 0.12);
  outline: none;
}

main section {
  padding: 1.2rem 0 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(255, 253, 247, 0.95));
  box-shadow: 0 8px 24px rgba(20, 32, 43, 0.08);
  padding: clamp(1rem, 1.5vw, 1.3rem);
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 1rem;
  display: grid;
  gap: 0.55rem;
  align-content: flex-start;
  min-height: 100%;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(20, 32, 43, 0.12);
  border-color: rgba(13, 143, 135, 0.5);
}

.card h3 {
  font-size: 1.18rem;
}

.card .meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.card p {
  margin: 0;
}

.tag {
  justify-self: start;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(13, 143, 135, 0.3);
  color: #0d726b;
  background: rgba(13, 143, 135, 0.13);
}

.card-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.inline-link:hover,
.inline-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.placeholder-link {
  color: var(--muted);
  font-size: 0.82rem;
}

.collection-link {
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px dashed transparent;
}

.collection-link:hover,
.collection-link:focus-visible {
  border-color: rgba(21, 32, 43, 0.35);
  outline: none;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.service-logo,
.service-fallback-logo {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
}

.service-logo {
  border-radius: 3px;
}

.service-fallback-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #1c3d58;
  border: 1px solid rgba(21, 32, 43, 0.22);
  background: rgba(13, 143, 135, 0.12);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.controls label {
  font-size: 0.82rem;
  color: var(--muted);
}

.controls select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem 0.55rem;
  font: inherit;
}

.link-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}

.link-column {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  padding: 0.95rem;
}

.link-column h3 {
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.link-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.link-column a {
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px dashed transparent;
}

.link-column a:hover,
.link-column a:focus-visible {
  border-color: rgba(21, 32, 43, 0.35);
  outline: none;
}

.blog-list .card h3 a {
  text-decoration: none;
}

.blog-list .card h3 a:hover,
.blog-list .card h3 a:focus-visible {
  text-decoration: underline;
}

.cta {
  padding: 1rem 0 3rem;
}

.cta .panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  background: linear-gradient(140deg, rgba(13, 143, 135, 0.15), rgba(228, 185, 73, 0.2));
}

.site-footer {
  border-top: 1px solid rgba(21, 32, 43, 0.15);
  margin-top: 1rem;
  padding: 1.2rem 0 1.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

.footer-link-icon {
  text-decoration: none;
}

.footer-icon-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(21, 32, 43, 0.22);
  color: #1e384d;
  background: linear-gradient(
    140deg,
    rgba(13, 143, 135, 0.2),
    rgba(228, 185, 73, 0.18)
  );
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.footer-brand-icon {
  width: 1.08rem;
  height: 1.08rem;
  display: block;
  object-fit: contain;
}

.footer-brand-icon-mail {
  width: 1.1rem;
  height: 1.1rem;
}

.footer-icon-fallback {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.footer-link-icon:hover .footer-icon-dot,
.footer-link-icon:focus-visible .footer-icon-dot {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(20, 32, 43, 0.16);
}

.blog-top,
.page-top {
  padding: 3rem 0 1.1rem;
}

.blog-top h1,
.page-top h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.blog-post {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.4rem 0 3.2rem;
}

.post-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 2vw, 2rem);
}

.post-back {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.post-back:hover,
.post-back:focus-visible {
  text-decoration: underline;
  outline: none;
}

.post-meta {
  margin: 0.6rem 0 1rem;
  color: var(--muted);
}

.post-shell #post-tags {
  margin-bottom: 1rem;
}

.post-body {
  display: grid;
  gap: 0.85rem;
}

.post-body p {
  margin: 0;
}

.post-body h2,
.post-body h3 {
  margin-top: 0.45rem;
}

.post-body ul {
  margin: 0;
  padding-left: 1.1rem;
}

.post-body a {
  color: var(--accent);
}

.post-body code {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.9em;
  background: rgba(21, 32, 43, 0.08);
  border-radius: 5px;
  padding: 0.1rem 0.3rem;
}

.post-body pre {
  margin: 0;
  background: #132236;
  color: #ecf3ff;
  border-radius: 10px;
  padding: 0.85rem;
  overflow-x: auto;
}

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

.post-body blockquote {
  margin: 0;
  padding-left: 0.8rem;
  border-left: 3px solid rgba(13, 143, 135, 0.45);
  color: var(--muted);
}

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

.error-page {
  padding: 3rem 0 3.8rem;
}

.error-panel {
  text-align: center;
}

.error-panel h1 {
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.error-image {
  width: min(100%, 760px);
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(20, 32, 43, 0.14);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms ease, transform 620ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .container {
    width: min(var(--max-width), calc(100% - 1.5rem));
  }

  .hero {
    padding-top: 3.2rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-side {
    justify-self: start;
    justify-content: flex-start;
    max-width: 250px;
    margin-top: 0.25rem;
    margin-left: 0;
  }

  .hero-portrait-frame {
    width: clamp(170px, 56vw, 240px);
  }

  .site-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    width: 100%;
  }

  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-head {
    margin-bottom: 0.75rem;
  }

  .card {
    padding: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
