:root{
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #161616;
  --muted: #5b5b5b;
  --accent: #1f4bd8;
  --border: #e7e3da;

  --radius: 14px;
  --maxw: 920px;
  --content: 740px;
}

* { box-sizing: border-box; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

header{
  position: sticky;
  top: 0;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  z-index: 10;
}

.header-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand a{ color: inherit; text-decoration: none; }

.brand-mark{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.brand-mark img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.brand-text .name{
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text .tagline{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop nav */
.nav-desktop{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-desktop a{
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
}

.nav-desktop a:hover{
  background: rgba(0,0,0,0.04);
  text-decoration: none;
}

.nav-desktop a[aria-current="page"]{
  background: rgba(31, 75, 216, 0.10);
  color: var(--text);
}

/* Mobile menu button */
.menu-btn{
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.menu-btn:focus{
  outline: 2px solid rgba(31, 75, 216, 0.35);
  outline-offset: 2px;
}

.menu-icon{
  width: 18px;
  height: 12px;
  position: relative;
}

.menu-icon span{
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.menu-icon span:nth-child(1){ top: 0; }
.menu-icon span:nth-child(2){ top: 5px; }
.menu-icon span:nth-child(3){ top: 10px; }

/* Mobile drawer */
.mobile-drawer{
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 0 0;
  margin-top: 12px;
}

.mobile-drawer a{
  display: block;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 12px;
  color: var(--text);
}

.mobile-drawer a:hover{
  background: rgba(0,0,0,0.04);
  text-decoration: none;
}

.mobile-drawer a[aria-current="page"]{
  background: rgba(31, 75, 216, 0.10);
}

header[data-menu-open="true"] .mobile-drawer{ display: block; }

main{
  max-width: var(--maxw);
  margin: 26px auto;
  padding: 0 18px 30px;
}

.hero{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Big logo in hero */
.hero-brand{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin-bottom: 14px;
}
.hero-logo{
  width: 120px;
  height: 120px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}
.hero-logo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-brand .site-name{
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h2{
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
}

.hero p{
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  text-align: center;
}

.hero .lede{ margin-top: 12px; }

/* Essay layout */
.essay-header{
  max-width: var(--content);
  margin: 0 auto 14px;
}
.essay-title{
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3.3vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.essay-subtitle{
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.essay-meta{
  max-width: var(--content);
  margin: 14px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.98rem;
}
.meta-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.essay-hero{
  max-width: var(--content);
  margin: 18px auto 18px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(0,0,0,0.04);
}
.essay-hero img{
  width: 100%;
  height: auto;
  display: block;
}
.essay-body{
  max-width: var(--content);
  margin: 0 auto;
}
.essay-body p{
  margin: 0 0 14px;
  font-size: 1.05rem;
}
.essay-body h3{
  margin: 26px 0 10px;
  font-size: 1.25rem;
}
.essay-body blockquote{
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid rgba(31, 75, 216, 0.35);
  background: rgba(31, 75, 216, 0.06);
  border-radius: 12px;
  color: var(--text);
}
.essay-body ul{ padding-left: 20px; }
.essay-body li{ margin: 8px 0; }

h2{ font-size: 1.6rem; margin: 0 0 14px; }
h3{ font-size: 1.2rem; margin: 26px 0 10px; }

.kicker{ color: var(--muted); margin-top: -6px; }

.card-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.card{
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card h3{ margin: 0 0 6px; }
.card p{ margin: 8px 0 0; color: var(--muted); }
.card .meta{
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 8px;
}

.controls{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.input, .select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
}
.tags{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tag{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
}
.tag[aria-pressed="true"]{
  border-color: rgba(31, 75, 216, 0.35);
  background: rgba(31, 75, 216, 0.10);
}
.small{ font-size: 0.95rem; color: var(--muted); }

footer{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px 40px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (min-width: 760px){
  .controls{ grid-template-columns: 2fr 1fr; align-items: start; }
}
@media (max-width: 860px){
  .brand-text .tagline{ display: none; }
}
@media (max-width: 760px){
  header{ padding: 10px 14px; }
  .nav-desktop{ display: none; }
  .menu-btn{ display: inline-flex; }
  .card{ grid-column: span 12; }
}
@media (max-width: 520px){
  .brand-mark{ width: 40px; height: 40px; border-radius: 11px; }
  .hero-logo{ width: 104px; height: 104px; border-radius: 20px; }
}
