:root {
  --brand: #3157d5;
  --brand-dark: #17328c;
  --accent: #c47f35;
  --ink-1: #111318;
  --ink-2: #3f4652;
  --ink-3: #747b88;
  --paper: #fbfaf7;
  --paper-2: #f3f0ea;
  --surface: #ffffff;
  --line: #ded8cc;
  --line-dark: rgba(255,255,255,.18);
}

html { scroll-behavior: smooth; }
html, body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-2);
  background: var(--paper);
}

body { overflow-x: hidden; }

h1, h2, h3, h4 {
  color: var(--ink-1);
  letter-spacing: -.035em;
}

h1, h2, .hero-title { font-family: Fraunces, Georgia, serif; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.navbar {
  background: rgba(251, 250, 247, .9) !important;
  border-bottom: 1px solid rgba(17,19,24,.08) !important;
  box-shadow: none !important;
  backdrop-filter: blur(18px);
}
.navbar-brand { letter-spacing: -.02em; color: var(--ink-1) !important; }
.navbar .nav-link { color: var(--ink-2); }
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--ink-1) !important; }
.dropdown-menu { border-color: var(--line); box-shadow: 0 18px 60px rgba(17,19,24,.1); }
.dropdown-item.active { background: var(--brand); }

.dropdown { position: relative; }
.navbar .dropdown-menu {
  --bs-dropdown-bg: #ffffff;
  --bs-dropdown-link-color: var(--ink-1);
  --bs-dropdown-link-hover-bg: var(--paper-2);
  --bs-dropdown-link-hover-color: var(--ink-1);
  --bs-dropdown-link-active-bg: var(--brand);
  --bs-dropdown-link-active-color: #ffffff;
  z-index: 2000;
  min-width: 12rem;
  padding: .5rem;
  border-radius: 1rem;
}
.navbar .dropdown-item {
  border-radius: .7rem;
  font-weight: 700;
}
.navbar .dropdown-toggle::after { vertical-align: .15em; }

.language-flags {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: .65rem;
}
.language-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.15rem;
  line-height: 1;
  filter: saturate(.88);
}
.language-flag:hover {
  background: rgba(17,19,24,.06);
  border-color: rgba(17,19,24,.12);
  filter: saturate(1);
}
.language-flag.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(17,19,24,.08);
  filter: saturate(1);
}

.btn { border-radius: 999px; font-weight: 700; }
.btn-primary {
  background: var(--ink-1);
  border-color: var(--ink-1);
  color: #fff;
}
.btn-primary:hover { background: #000; border-color: #000; }
.btn-outline-primary {
  color: var(--ink-1);
  border-color: rgba(17,19,24,.24);
  background: transparent;
}
.btn-outline-primary:hover {
  color: #fff;
  background: var(--ink-1);
  border-color: var(--ink-1);
}

.editorial-hero {
  position: relative;
  padding: clamp(5rem, 9vw, 8rem) 0 clamp(4rem, 7vw, 7rem);
  background:
    radial-gradient(circle at 8% 0%, rgba(49,87,213,.12), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(196,127,53,.12), transparent 24%),
    linear-gradient(180deg, var(--paper) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.editorial-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(17,19,24,.22), transparent);
}
.eyebrow {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero-title {
  max-width: 980px;
  font-size: clamp(3.25rem, 7.2vw, 6.8rem);
  line-height: .92;
  font-weight: 700;
}
.hero-summary {
  max-width: 760px;
  color: var(--ink-2);
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
  line-height: 1.65;
}
.hero-actions,
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
}
.hero-links a {
  color: var(--ink-1);
  font-weight: 700;
  text-decoration: none;
}
.hero-links a:hover { color: var(--brand); }
.profile-card {
  width: min(100%, 320px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: rgba(255,255,255,.72);
  box-shadow: 0 24px 80px rgba(17,19,24,.08);
}
.profile-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--paper-2);
}
.profile-photo .img-cover {
  object-position: center 22%;
}
.img-cover { width: 100%; height: 100%; object-fit: cover; }
.profile-card-body {
  padding: 1.1rem;
  display: grid;
  gap: .25rem;
}
.profile-name { color: var(--ink-1); font-size: 1.08rem; font-weight: 800; }
.profile-role { color: var(--ink-3); font-size: .92rem; line-height: 1.4; }

.section-block { padding: clamp(4rem, 7vw, 7rem) 0; }
.section-heading { max-width: 980px; }
.section-heading h2 {
  margin: .4rem 0 0;
  font-size: clamp(2.1rem, 4vw, 4.5rem);
  line-height: 1;
}
.selected-work { background: #fff; }
.featured-projects {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 1rem;
}
.feature-project {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background:
    linear-gradient(135deg, rgba(49,87,213,.08), transparent 36%),
    var(--paper);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-project:hover { transform: translateY(-4px); box-shadow: 0 28px 80px rgba(17,19,24,.1); }
.feature-project-dark {
  background:
    radial-gradient(circle at 20% 15%, rgba(49,87,213,.38), transparent 32%),
    linear-gradient(135deg, #12151c 0%, #1c2333 100%);
  color: rgba(255,255,255,.74);
  border-color: rgba(255,255,255,.12);
}
.feature-project h3 {
  margin: 1rem 0;
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1;
}
.feature-project-dark h3 { color: #fff; }
.feature-project p {
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.65;
}
.project-index {
  font-weight: 900;
  color: var(--accent);
  letter-spacing: .12em;
}
.feature-project a,
.read-more {
  color: currentColor;
  font-weight: 800;
  text-decoration: none;
}
.feature-project:not(.feature-project-dark) a,
.read-more { color: var(--brand); }
.feature-project a:hover,
.read-more:hover { text-decoration: underline; text-underline-offset: 4px; }

.project-list {
  border-top: 1px solid var(--line);
}
.project-row {
  display: grid;
  grid-template-columns: 180px 220px minmax(0,1fr);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.25rem 0;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.project-row:hover { color: var(--ink-1); }
.project-row-label {
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.project-row strong {
  color: var(--ink-1);
  font-size: 1.2rem;
}
.project-row span:last-child { line-height: 1.55; }

.writing-block {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sticky-heading { position: sticky; top: 6rem; }
.writing-card {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(17,19,24,.18), rgba(17,19,24,.84)),
    radial-gradient(circle at 20% 0%, rgba(49,87,213,.55), transparent 36%),
    #111318;
  color: rgba(255,255,255,.76);
  box-shadow: 0 28px 100px rgba(17,19,24,.16);
}
.writing-card h3 {
  margin: .8rem 0 1rem;
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}
.writing-card h3 a { color: #fff; text-decoration: none; }
.writing-card h3 a:hover { text-decoration: underline; text-underline-offset: 6px; }
.post-meta { color: var(--ink-3); font-size: .95rem; font-weight: 700; }
.writing-card .post-meta { color: rgba(255,255,255,.58); }
.writing-card .read-more { color: #fff; }

.principles-block { background: #fff; }
.principles-block .section-heading { max-width: 820px; }
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  overflow: hidden;
}
.principle-item {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--paper);
}
.principle-item span {
  color: var(--accent);
  font-weight: 900;
  letter-spacing: .12em;
}
.principle-item h3 { margin-top: 1rem; font-size: 1.35rem; }
.principle-item p { margin-bottom: 0; line-height: 1.65; }

.contact-block {
  background: var(--ink-1);
  color: rgba(255,255,255,.72);
}
.contact-block h2 { color: #fff; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; }
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 2rem;
  align-items: end;
}
.contact-panel p { max-width: 760px; font-size: 1.05rem; line-height: 1.7; }
.contact-links {
  display: grid;
  gap: .75rem;
}
.contact-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
}
.contact-links a:hover { background: rgba(255,255,255,.08); }

.divider { height: 1px; background: var(--line); }
.site-footer { background: var(--paper); }
.footer-link { color: var(--ink-2); text-decoration: none; opacity: .95; }
.footer-link:hover { color: var(--ink-1); text-decoration: underline; text-underline-offset: 4px; }
.social-links .btn {
  border-radius: 999px;
  padding: .4rem .6rem;
  line-height: 1;
}
.social-links .btn i { font-size: 1rem; }

/* Generic MkDocs/blog pages */
.page-hero {
  background: var(--paper-2) !important;
  border-bottom: 1px solid var(--line);
}
.page-hero .lead { color: var(--ink-2); }
.soft-card {
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
}
.soft-shadow { box-shadow: 0 18px 70px rgba(17,19,24,.08); }
.bg-mint, .bg-sky, .bg-peach { background: var(--paper-2) !important; }
.chip {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .75rem;
  background: #fff;
  color: var(--ink-1);
  font-size: .86rem;
  font-weight: 800;
}
.blog-card h2 a { color: var(--ink-1); text-decoration: none; }
.blog-card h2 a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.blog-back-link { color: var(--brand); font-weight: 800; text-decoration: none; }
.blog-back-link:hover { text-decoration: underline; }
.blog-post { background: #fff; }
.blog-post-header h1 {
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1;
}
.blog-post-content {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--ink-2);
}
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 { margin-top: 2.4rem; margin-bottom: .85rem; }
.blog-post-content p,
.blog-post-content ul,
.blog-post-content ol,
.blog-post-content blockquote,
.blog-post-content pre { margin-bottom: 1.2rem; }
.blog-post-content img { max-width: 100%; height: auto; border-radius: 1rem; }
.blog-post-content blockquote { border-left: 4px solid var(--accent); padding-left: 1rem; color: var(--ink-1); }
.blog-post-content pre { background: #111318; color: #f4f1e9; padding: 1rem; border-radius: 1rem; overflow-x: auto; }
.blog-post-content code { background: var(--paper-2); color: var(--brand-dark); padding: .15rem .3rem; border-radius: .35rem; }
.blog-post-content pre code { background: transparent; color: inherit; padding: 0; }

@media (max-width: 991.98px) {
  .hero-title { font-size: clamp(3rem, 13vw, 5rem); }
  .profile-card { margin-top: 1rem; max-width: 280px; }
  .featured-projects,
  .principles-grid,
  .contact-panel { grid-template-columns: 1fr; }
  .feature-project { min-height: 340px; }
  .project-row { grid-template-columns: 1fr; gap: .35rem; }
  .sticky-heading { position: static; }
}

@media (max-width: 575.98px) {
  .editorial-hero { padding-top: 4rem; }
  .hero-actions .btn { width: 100%; }
  .feature-project,
  .writing-card,
  .contact-links a { border-radius: 1.25rem; }
  .principles-grid { border-radius: 1.25rem; }
}
