/* ==========================================================================
   Badran A. Badran, consulting site
   Direction: "The Charter". Committed navy and brass on white.
   Type: Libre Caslon Text (display, prose) + Public Sans (structure).
   Edit colors here once; every page reads from these variables.
   ========================================================================== */

:root {
  --navy: #08273a;        /* oklch(.26 .05 240)  brand field, headings */
  --navy-deep: #021b2b;   /* oklch(.21 .045 240) hero floor, footer */
  --ink: #1c2b37;         /* oklch(.28 .03 245)  body text on white */
  --muted: #4a5763;       /* oklch(.45 .025 245) secondary text */
  --brass: #a78246;       /* oklch(.63 .09 78)   rules and marks only */
  --brass-text: #845922;  /* oklch(.50 .09 70)   small accent text, AA on white */
  --brass-navy: #d9b97e;  /* oklch(.80 .085 82)  accents on navy */
  --hero-text: #f5f3ef;   /* oklch(.965 .006 95) text on navy */
  --wash: #edf1f4;        /* oklch(.955 .006 240) tinted section */
  --wash-line: #d5dce1;   /* hairlines on wash */
  --white: #ffffff;
  --confirm-bg: #fdf3d7;  /* pre-launch placeholder highlight */
  --confirm-ink: #6d5314;
  --serif: "Libre Caslon Text", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--brass); color: var(--navy-deep); }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1060px; margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--white); color: var(--navy); font-family: var(--sans);
  padding: 0.6rem 1rem; text-decoration: underline;
}
.skip:focus { left: 0; }

/* Pre-launch placeholders: search the files for "[CONFIRM" to find them all */
.confirm {
  background: var(--confirm-bg);
  color: var(--confirm-ink);
  font-family: var(--sans);
  font-size: 0.85em;
  padding: 0.05em 0.35em;
  border-radius: 2px;
  white-space: nowrap;
}

/* ---------- Header on the navy field ---------- */
.field { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); color: var(--hero-text); }
header { border-bottom: 1px solid rgba(217, 185, 126, 0.28); }
.bar { display: flex; align-items: center; justify-content: space-between; padding-block: 1.1rem; gap: 1rem; }
.wordmark {
  font-family: var(--serif); font-size: 1.06rem; letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap;
}
nav ul { display: flex; gap: clamp(1rem, 2.5vw, 2rem); list-style: none; }
nav a {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  color: var(--hero-text); padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--brass-navy); }
.nav-toggle {
  display: none; background: none; border: 1px solid rgba(245, 243, 239, 0.4);
  color: var(--hero-text); font-family: var(--sans); font-size: 0.78rem;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 0.45rem 0.8rem; cursor: pointer;
}

/* ---------- Home hero ---------- */
.hero { text-align: center; padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3.75rem, 9vw, 6.75rem); }
html.anim .hero > * { animation: rise 0.7s cubic-bezier(0.25, 1, 0.5, 1) both; }
html.anim .hero > *:nth-child(2) { animation-delay: 0.08s; }
html.anim .hero > *:nth-child(3) { animation-delay: 0.16s; }
html.anim .hero > *:nth-child(4) { animation-delay: 0.24s; }
html.anim .hero > *:nth-child(5) { animation-delay: 0.32s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rule-orn { width: 72px; margin: 0 auto 1.6rem; border: 0; border-top: 1px solid var(--brass-navy); position: relative; }
.rule-orn::after {
  content: ""; position: absolute; left: 0; right: 0; top: 3px;
  border-top: 1px solid rgba(217, 185, 126, 0.45);
}
h1 { text-wrap: balance; }
.hero h1 {
  font-size: clamp(2.35rem, 7vw, 4.4rem); font-weight: 400; line-height: 1.08;
  letter-spacing: 0.005em; margin: 0 0 1.3rem;
}
.titleline {
  font-family: var(--sans); font-size: clamp(0.86rem, 1.6vw, 0.98rem);
  font-weight: 400; letter-spacing: 0.04em; color: var(--hero-text);
  max-width: 46rem; margin: 0 auto; line-height: 1.8;
}
.titleline span { white-space: nowrap; }
.titleline span:not(:last-child)::after { content: "\00B7"; color: var(--brass-navy); margin: 0 0.65em; }
.lede {
  font-style: italic; font-size: clamp(1.08rem, 2vw, 1.24rem); line-height: 1.7;
  max-width: 38rem; margin: 1.7rem auto 0; color: var(--hero-text);
}
.hero-cta { margin-top: 2.4rem; display: flex; justify-content: center; align-items: center; gap: 1.75rem; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--hero-text); color: var(--navy-deep);
  font-family: var(--sans); font-weight: 600; font-size: 0.86rem;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  padding: 0.95rem 2.1rem; border: 1px solid var(--hero-text); cursor: pointer;
  transition: background 0.25s cubic-bezier(0.25, 1, 0.5, 1), color 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
.btn:hover { background: transparent; color: var(--hero-text); }
.btn-solid {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}
.btn-solid:hover { background: var(--navy-deep); color: var(--white); border-color: var(--navy-deep); }
.ghostlink {
  font-family: var(--sans); font-size: 0.86rem; letter-spacing: 0.04em;
  color: var(--brass-navy); text-decoration: underline;
  text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.ghostlink:hover { color: var(--hero-text); }

/* ---------- Interior page band ---------- */
.band { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2.75rem, 6vw, 4.25rem); }
.band h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 400; line-height: 1.12; }
.band .dek {
  font-family: var(--sans); font-size: clamp(0.92rem, 1.7vw, 1.02rem);
  color: var(--brass-navy); letter-spacing: 0.03em; margin-top: 0.9rem; max-width: 54rem;
}

/* ---------- Home introduction ---------- */
.intro { padding-block: clamp(3.5rem, 8vw, 6rem); }
.intro-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(2.5rem, 5vw, 4rem); align-items: start; }
.plate { position: relative; border: 1px solid var(--navy); background: var(--white); }
.plate img { width: 100%; }
.plate::after {
  content: ""; position: absolute; inset: 10px -10px -10px 10px;
  border: 1px solid var(--brass); z-index: -1;
}
.plate figcaption {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--muted); padding: 0.8rem 0.95rem 0.9rem;
  border-top: 1px solid var(--wash-line);
}
.intro h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 400; color: var(--navy);
  line-height: 1.3; margin-bottom: 1.4rem; text-wrap: balance;
}
.intro p { max-width: 62ch; margin-bottom: 1.15rem; }
.intro p.mut { color: var(--muted); }
.marks {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass-text);
  margin: 1.9rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--wash);
  line-height: 2.1;
}
.marks b { font-weight: 500; white-space: nowrap; }
.marks b:not(:last-child)::after { content: "\00B7"; color: var(--brass); margin: 0 0.8em; }

/* ---------- Contents index (home) ---------- */
.index { background: var(--wash); padding-block: clamp(3rem, 7vw, 5rem) clamp(3.5rem, 8vw, 5.5rem); }
.index h2 {
  font-size: 1.02rem; font-weight: 400; font-style: italic; color: var(--muted);
  margin-bottom: 2rem;
}
.index ol { list-style: none; border-top: 1px solid var(--wash-line); }
.index li { border-bottom: 1px solid var(--wash-line); }
.index a {
  display: grid; grid-template-columns: minmax(9.5rem, 14rem) 1fr auto;
  gap: 1.5rem; align-items: baseline; padding: 1.35rem 0.6rem;
  text-decoration: none; transition: background 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
.index a:hover { background: var(--white); }
.index .t { font-size: 1.22rem; color: var(--navy); }
.index .d { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); line-height: 1.55; }
.index .arr { font-family: var(--sans); color: var(--brass-text); font-size: 1rem; }

/* ---------- Shared content area ---------- */
.content { padding-block: clamp(3rem, 7vw, 5rem) clamp(3.5rem, 8vw, 5.5rem); }
.content h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.65rem); font-weight: 400; color: var(--navy);
  padding-bottom: 0.8rem; border-bottom: 1px solid var(--brass);
  margin-bottom: 1.6rem; text-wrap: balance;
}
.content section + section { margin-top: clamp(2.75rem, 6vw, 4rem); }

/* ---------- Biography ---------- */
.bio-grid { display: grid; grid-template-columns: 1fr 300px; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }
.bio-text p { max-width: 66ch; margin-bottom: 1.25rem; }
.bio-text .btn { margin-top: 0.8rem; }
blockquote.creed {
  border-top: 1px solid var(--brass); border-bottom: 1px solid var(--brass);
  padding: 1.6rem 0.25rem; margin: 2rem 0;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem); font-style: italic; line-height: 1.6;
  color: var(--navy); max-width: 58ch; text-wrap: pretty;
}

/* ---------- Publications ---------- */
.pubs-note { font-family: var(--sans); color: var(--muted); max-width: 62ch; margin-bottom: 2.25rem; font-size: 0.95rem; }
ul.pubs { list-style: none; border-top: 1px solid var(--wash-line); max-width: 56rem; }
.pubs li { border-bottom: 1px solid var(--wash-line); padding: 1.3rem 0.4rem; }
.pub-title { display: block; font-size: 1.12rem; line-height: 1.5; color: var(--navy); max-width: 62ch; }
a.pub-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--brass); }
a.pub-title:hover { text-decoration-color: var(--navy); }
.pub-meta { display: block; font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin-top: 0.4rem; }
.pub-meta em { font-style: italic; font-family: var(--serif); font-size: 0.95rem; }
.pubs-fine { margin-top: 2.25rem; max-width: 62ch; color: var(--muted); }
.pubs-fine a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brass); }

/* ---------- Credentials ---------- */
.cred-rows { border-top: 1px solid var(--wash-line); }
.cred-row {
  display: grid; grid-template-columns: 10.5rem 1fr; gap: 1.5rem;
  padding: 1.2rem 0.4rem; border-bottom: 1px solid var(--wash-line);
}
.cred-when { font-family: var(--sans); font-size: 0.84rem; font-weight: 600; letter-spacing: 0.04em; color: var(--brass-text); padding-top: 0.2rem; }
.cred-what { font-size: 1.08rem; line-height: 1.5; }
.cred-what small { display: block; font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin-top: 0.35rem; max-width: 66ch; }
ul.cred-list { list-style: none; max-width: 56rem; }
.cred-list li { padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--wash-line); }
.cred-list li:first-child { border-top: 1px solid var(--wash-line); }
.cred-list small { display: block; font-family: var(--sans); font-size: 0.88rem; color: var(--muted); margin-top: 0.2rem; }
ul.cred-cols {
  list-style: none; columns: 2; column-gap: 3rem; max-width: 56rem;
}
.cred-cols li {
  break-inside: avoid; padding: 0.45rem 0.4rem 0.45rem 1.2rem; position: relative;
}
.cred-cols li::before { content: ""; position: absolute; left: 0.1rem; top: 1.05em; width: 0.55rem; height: 1px; background: var(--brass); }
.cred-note { font-family: var(--sans); color: var(--muted); font-size: 0.95rem; max-width: 62ch; margin-bottom: 1.4rem; }

/* ---------- Contact ---------- */
.contact-lead .plate { max-width: 320px; margin-top: 2.4rem; }

.plate-inline { max-width: 340px; margin-bottom: 2.5rem; }

/* ---------- Recognition gallery (credentials) ---------- */
.awards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.25rem 2.5rem; align-items: start; max-width: 62rem;
}
.awards img { border: 1px solid var(--navy); }
.awards figcaption {
  font-family: var(--sans); font-size: 0.85rem; color: var(--muted);
  line-height: 1.55; margin-top: 0.7rem; max-width: 46ch;
}
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.contact-lead p { max-width: 52ch; margin-bottom: 1.2rem; }
.contact-lead .mut { color: var(--muted); }
.bigmail {
  display: inline-block; font-size: clamp(1.15rem, 2.4vw, 1.45rem); color: var(--navy);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--brass);
  margin-bottom: 1.6rem; overflow-wrap: anywhere;
}
.bigmail:hover { text-decoration-color: var(--navy); }
form { max-width: 34rem; }
.fieldrow { margin-bottom: 1.3rem; }
label {
  display: block; font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy);
  margin-bottom: 0.45rem;
}
label .opt { font-weight: 400; text-transform: none; letter-spacing: 0.02em; color: var(--muted); }
input, textarea {
  width: 100%; font-family: var(--serif); font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1px solid #b9c2ca; border-radius: 0;
  padding: 0.75rem 0.85rem; transition: border-color 0.2s ease-out;
}
input:focus, textarea:focus { border-color: var(--navy); }
textarea { min-height: 9.5rem; resize: vertical; }
.form-foot { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.mail-fallback { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }
.mail-fallback a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brass); }
.form-note {
  display: none; margin-top: 1.2rem; padding: 0.9rem 1rem;
  background: var(--confirm-bg); color: var(--confirm-ink);
  font-family: var(--sans); font-size: 0.9rem; line-height: 1.55;
}
.form-note.show { display: block; }
.form-note a { color: inherit; }

/* ---------- Biography: speaking figure ---------- */
.stagefig { margin-top: clamp(2.5rem, 6vw, 4rem); }
.stagefig img { width: 100%; height: auto; border: 1px solid var(--navy); }
.stagefig figcaption {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--muted); margin-top: 0.9rem;
}

/* ---------- Writing list ---------- */
ul.posts { list-style: none; border-top: 1px solid var(--wash-line); max-width: 56rem; }
.posts li { border-bottom: 1px solid var(--wash-line); padding: 1.3rem 0.4rem; }
.post-date {
  display: block; font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--brass-text);
  margin-bottom: 0.35rem;
}
a.post-title {
  display: inline-block; font-size: 1.22rem; line-height: 1.45; color: var(--navy);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--brass);
}
a.post-title:hover { text-decoration-color: var(--navy); }
.post-sum {
  display: block; font-family: var(--sans); font-size: 0.92rem; color: var(--muted);
  margin-top: 0.45rem; max-width: 62ch; line-height: 1.6;
}
.posts li { padding-block: 2rem 2.2rem; }
.posts .post-title-h {
  font-size: clamp(1.25rem, 2.4vw, 1.5rem); font-weight: 400; color: var(--navy);
  line-height: 1.35; margin: 0.15rem 0 0.9rem; border: 0; padding: 0; text-wrap: balance;
}
.post-body { max-width: 66ch; }
.post-body p { margin-bottom: 1.05rem; }
.post-body p:last-child { margin-bottom: 0; }
.post-body[dir="rtl"] { text-align: right; font-size: 1.06rem; line-height: 1.95; }
.post-src {
  display: inline-block; margin-top: 1.1rem; font-family: var(--sans); font-size: 0.84rem;
  color: var(--brass-text); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--brass);
}
.post-src:hover { color: var(--navy); }
.pager {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  max-width: 56rem; margin-top: 2.2rem; font-family: var(--sans); font-size: 0.9rem;
}
.pager a { color: var(--brass-text); text-decoration: underline; text-underline-offset: 3px; }
.pager a:hover { color: var(--navy); }
.pager .pg-where { color: var(--muted); }

/* ---------- Article pages ---------- */
.article { max-width: 44rem; }
.article p { margin-bottom: 1.25rem; }
.article h2 { margin-top: 2.2rem; }
.article .backlink {
  display: inline-block; margin-top: 1.6rem; font-family: var(--sans);
  font-size: 0.88rem; color: var(--brass-text);
  text-decoration: underline; text-underline-offset: 3px;
}
.article .backlink:hover { color: var(--navy); }

/* ---------- Footer ---------- */
footer { background: var(--navy-deep); color: var(--hero-text); padding-block: 3rem 3.4rem; }
.foot { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: baseline; }
.foot .name { font-size: 1.05rem; }
.foot .sub { font-family: var(--sans); font-size: 0.8rem; color: var(--brass-navy); letter-spacing: 0.05em; margin-top: 0.4rem; }
.foot ul { list-style: none; display: flex; gap: 1.6rem; flex-wrap: wrap; }
.foot ul a { font-family: var(--sans); font-size: 0.84rem; text-decoration: underline; text-underline-offset: 4px; }
.foot .fine { width: 100%; font-family: var(--sans); font-size: 0.75rem; color: rgba(245, 243, 239, 0.6); margin-top: 1.6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bio-grid { grid-template-columns: 1fr; }
  .bio-grid .plate { max-width: 300px; order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .intro-grid { grid-template-columns: 1fr; }
  .intro .plate { max-width: 300px; }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  nav { display: none; width: 100%; }
  nav.open { display: block; }
  nav ul { flex-direction: column; gap: 0; padding: 0.5rem 0 1rem; }
  nav a { display: block; padding: 0.7rem 0; border-bottom: 1px solid rgba(245, 243, 239, 0.12); }
  .bar { flex-wrap: wrap; }
  .index a { grid-template-columns: 1fr auto; }
  .index .d { grid-column: 1 / -1; grid-row: 2; }
  .cred-row { grid-template-columns: 1fr; gap: 0.3rem; }
  ul.cred-cols { columns: 1; }
}
@media (max-width: 620px) {
  .titleline { line-height: 1.65; }
  .titleline span { display: block; white-space: normal; }
  .titleline span:not(:last-child)::after { content: none; }
  .marks b { display: block; }
  .marks b:not(:last-child)::after { content: none; }
  .confirm { white-space: normal; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.anim .hero > * { animation: none; }
  * { transition: none !important; }
}
