/* Ink & Quill (INQEDU) — site styles
   Layout idea: a printed page. A narrow left margin carries section labels,
   like marginalia; the main column carries the text; hairline rules divide. */

@font-face { font-family: "Libre Baskerville"; src: url("../assets/fonts/libre-baskerville-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../assets/fonts/libre-baskerville-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../assets/fonts/libre-baskerville-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../assets/fonts/almarai-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../assets/fonts/almarai-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Almarai"; src: url("../assets/fonts/almarai-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #F6F3EC;
  --linen: #ECE4DA;
  --sand: #B9A590;
  --umber: #574C3F;
  --ink: #36302A;
  --rule: rgba(87, 76, 63, 0.22);
  --display: "Libre Baskerville", Baskerville, "Times New Roman", serif;
  --body: "Almarai", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
  --margin-col: 190px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--umber);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--sand); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.12; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.2; }
h3 { font-size: 1.3rem; line-height: 1.3; }
h1 em, h2 em { font-style: italic; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.label {
  font-family: var(--body); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--umber);
}
.lede { font-size: 1.2rem; line-height: 1.6; max-width: 34em; }
.measure { max-width: 38em; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 12px; top: 12px; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  font-family: var(--body); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 1.05em 1.7em; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--umber); border-color: var(--umber); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: var(--linen); border-color: var(--linen); color: var(--ink); }
.more { font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; display: inline-flex; gap: 0.6em; align-items: center; border-bottom: 1px solid var(--sand); padding-bottom: 0.35em; }
.more::after { content: "\2192"; transition: transform 0.2s; }
.more:hover::after { transform: translateX(4px); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(246, 243, 236, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 60px; width: auto; }
.brand-name { font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 1.85rem); color: var(--ink); line-height: 1.1; white-space: nowrap; }
.brand-name small { display: block; font-family: var(--body); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--umber); margin-top: 6px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 36px); }
.nav a:not(.btn) { font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.nav .btn { padding: 0.85em 1.3em; }
.nav-toggle { display: none; background: none; border: 1px solid var(--ink); border-radius: 2px; padding: 9px 14px; font: inherit; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px var(--gutter) 24px; }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 10px 0; font-size: 0.9rem; }
  .nav .btn { margin-top: 10px; }
}

/* Bands: margin label + main column */
.band { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--rule); }
.band--linen { background: var(--linen); }
.band--flush { border-top: 0; }
.cols { display: grid; grid-template-columns: var(--margin-col) minmax(0, 1fr); gap: 32px clamp(24px, 4vw, 56px); }
.cols > .label { padding-top: 0.9em; border-top: 1px solid var(--ink); align-self: start; }
.band-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: clamp(32px, 4vw, 52px); }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; gap: 22px; } .cols > .label { justify-self: start; padding-right: 2em; } }

/* Hero */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 8vw, 104px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 1.6rem; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; } }

/* The annotated passage */
.reading { margin: 0; background: var(--linen); border: 1px solid var(--rule); padding: clamp(24px, 3.4vw, 44px); position: relative; }
.reading::before { content: ""; position: absolute; left: clamp(14px, 1.6vw, 22px); top: 0; bottom: 0; border-left: 1px solid rgba(185, 165, 144, 0.7); }
.reading > * { position: relative; }
.reading .label { display: block; margin-bottom: 1.4rem; }
.poem { margin: 0 0 1.6rem; font-family: var(--display); font-style: italic; color: var(--ink); font-size: clamp(1.02rem, 1.45vw, 1.2rem); line-height: 1.95; }
.poem .line { display: block; padding-left: 1.4em; text-indent: -1.4em; }
.poem mark {
  color: inherit; padding: 0 0.08em;
  background: linear-gradient(var(--sand), var(--sand)) left 88% / 100% 0.36em no-repeat;
  animation: underline 0.7s ease-out backwards; transition: background-color 0.2s;
}
.poem mark[data-n="1"] { animation-delay: 0.35s; }
.poem mark[data-n="2"] { animation-delay: 0.85s; }
.poem mark[data-n="3"] { animation-delay: 1.35s; }
.poem mark::after { content: attr(data-n); font-family: var(--body); font-style: normal; font-weight: 700; font-size: 0.58em; vertical-align: super; margin-left: 0.15em; color: var(--umber); }
.poem mark.is-active { background-color: var(--sand); }
@keyframes underline { from { background-size: 0 0.36em; } }
.notes { list-style: none; margin: 0; padding: 1.3rem 0 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.85rem; counter-reset: note; }
.notes li { counter-increment: note; display: grid; grid-template-columns: 1.6em 1fr; font-size: 0.93rem; line-height: 1.55; padding: 2px 4px; margin: 0 -4px; border-radius: 2px; transition: background-color 0.2s; }
.notes li::before { content: counter(note); font-weight: 800; color: var(--ink); }
.notes li.is-active { background: rgba(185, 165, 144, 0.3); }
.notes strong { color: var(--ink); font-family: var(--display); font-style: italic; font-weight: 400; }
.source { margin-top: 1.3rem; font-size: 0.8rem; letter-spacing: 0.04em; }

/* Cards and grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; gap: 1rem; padding: clamp(24px, 3vw, 38px); background: var(--paper); border: 1px solid var(--rule); }
.band:not(.band--linen) .card { background: var(--linen); border-color: transparent; }
.card .more { margin-top: auto; align-self: flex-start; }
.card-link { text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.card-link:hover { border-color: var(--umber) !important; transform: translateY(-2px); }
.card-link h3 { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; transition: text-decoration-color 0.2s; }
.card-link:hover h3 { text-decoration-color: var(--sand); }
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-weight: 700; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid var(--sand); border-radius: 999px; padding: 0.35em 1em; color: var(--umber); }

/* Also-taught list */
.also { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 44px); }
.also li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 0.95rem 0; border-bottom: 1px solid var(--rule); }
.also a { font-family: var(--display); font-size: 1.08rem; text-decoration: none; }
.also a:hover { text-decoration: underline; text-decoration-color: var(--sand); }
.also span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; white-space: nowrap; }
@media (max-width: 680px) { .also { grid-template-columns: 1fr; } }
.subject { scroll-margin-top: 100px; }

/* Principles: three ruled columns */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 44px); }
.principles > div { border-top: 1px solid var(--ink); padding-top: 1.3rem; display: flex; flex-direction: column; gap: 0.8rem; }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr; } }

/* Ruled list (assessments) */
.ruled { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ruled li { display: grid; grid-template-columns: minmax(150px, 0.34fr) 1fr; gap: 8px 32px; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.ruled h3 { font-size: 1.2rem; }
.ruled .note { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 0.4em; }
@media (max-width: 600px) { .ruled li { grid-template-columns: 1fr; } }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 520px; }
th, td { text-align: left; padding: 0.95rem 1rem 0.95rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--ink); }
tbody th { font-family: var(--display); font-weight: 400; color: var(--ink); font-size: 1.05rem; }
.small { font-size: 0.88rem; }

/* Course blocks */
.course { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--ink); scroll-margin-top: 100px; }
.course:last-child { padding-bottom: 0; }
.course ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.course li { padding: 0.75rem 0 0.75rem 1.6em; border-bottom: 1px solid var(--rule); position: relative; }
.course li::before { content: ""; position: absolute; left: 0; top: 1.45em; width: 0.8em; border-top: 1px solid var(--ink); }
@media (max-width: 780px) { .course { grid-template-columns: 1fr; } }

/* Page head */
.page-head { padding: clamp(48px, 7vw, 92px) 0 clamp(40px, 5vw, 64px); }
.page-head .wrap { display: flex; flex-direction: column; gap: 1.4rem; }

/* CTA band */
.cta { background: var(--ink); color: var(--linen); padding: clamp(56px, 8vw, 100px) 0; }
.cta .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.cta h2 { color: var(--paper); }
.cta p { max-width: 34em; margin-top: 1rem; }
.cta .label { color: var(--sand); display: block; margin-bottom: 1rem; }
@media (max-width: 760px) { .cta .wrap { grid-template-columns: 1fr; align-items: start; } }

/* Guides */
.post-card .meta, .meta { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; display: flex; gap: 0.9em; flex-wrap: wrap; }
.meta span + span::before { content: "\00B7"; margin-right: 0.9em; }
.article { max-width: 42em; margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(56px, 8vw, 104px); }
.article header { display: flex; flex-direction: column; gap: 1.3rem; padding-bottom: 2.2rem; margin-bottom: 2.2rem; border-bottom: 1px solid var(--ink); }
.article h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
.prose { display: flex; flex-direction: column; gap: 1.25rem; font-size: 1.1rem; line-height: 1.75; }
.prose h2 { font-size: 1.55rem; margin-top: 1.4rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 0.6rem; }
.prose blockquote { margin: 0.4rem 0; padding: 1.2rem 1.5rem; background: var(--linen); border-left: 2px solid var(--sand); font-family: var(--display); font-style: italic; color: var(--ink); line-height: 1.8; }
.prose blockquote cite { display: block; font-family: var(--body); font-style: normal; font-size: 0.8rem; margin-top: 0.6rem; color: var(--umber); }
.prose strong { color: var(--ink); }
.article footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
@media (max-width: 560px) { form { grid-template-columns: 1fr; } }
label { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
label .opt { font-weight: 400; text-transform: none; letter-spacing: 0.02em; color: var(--umber); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--sand); border-radius: 2px; padding: 0.85em 0.95em; width: 100%; }
.band--linen input, .band--linen select, .band--linen textarea { background: var(--paper); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
textarea { min-height: 150px; resize: vertical; }
.form-status { grid-column: 1 / -1; padding: 1rem 1.2rem; border: 1px solid var(--ink); background: var(--linen); color: var(--ink); }
.form-status[hidden] { display: none; }
.details { display: flex; flex-direction: column; border-top: 1px solid var(--ink); margin: 0; }
.details div { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.details dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin-bottom: 0.3rem; }
.details dd { margin: 0; }
.todo { font-style: italic; opacity: 0.8; }

/* Footer */
.site-footer { background: var(--linen); border-top: 1px solid var(--rule); padding: clamp(44px, 6vw, 72px) 0 28px; }
.site-footer .top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr)); gap: 36px; padding-bottom: 40px; }
.site-footer .logo { width: min(300px, 80%); margin-bottom: 1.2rem; }
.site-footer ul { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .bottom { border-top: 1px solid var(--rule); padding-top: 22px; font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (max-width: 760px) { .site-footer .top { grid-template-columns: 1fr; } }

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