/* writings.notch.finance — tokens taken from the live site (web/app/globals.css) */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --obsidian: #141210;
  --obsidian-elevated: #1A1815;
  --obsidian-border: #29251F;
  --amber: #E8A019;
  --amber-glow: #E8A01926;
  --amber-dim: #C4891A;
  --chalk: #DCD7CC;
  --chalk-muted: #9C968B;
}

[data-theme="paper"] {
  --obsidian: #F4EFE5;
  --obsidian-elevated: #FBF7EE;
  --obsidian-border: #E1D9C8;
  --amber: #9A6300;
  --amber-glow: rgba(154, 99, 0, 0.14);
  --amber-dim: #7E5200;
  --chalk: #262219;
  --chalk-muted: #6B6455;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--chalk);
  font-family: var(--body-font);
  line-height: var(--body-leading);
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

html[lang="en"] body {
  --body-font: "Satoshi", system-ui, sans-serif;
  --display-font: "Instrument Serif", serif;
  --body-leading: 1.75;
}
html[lang="ar"] body {
  --body-font: "IBM Plex Sans Arabic", "Satoshi", system-ui, sans-serif;
  --display-font: "Amiri", "Instrument Serif", serif;
  --body-leading: 2.05;
}

.shell {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── header ── */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 1.1rem;
  border-bottom: 1px solid var(--obsidian-border);
  margin-bottom: 3rem;
}
.wordmark {
  font-family: "Instrument Serif", serif;
  font-size: 1.35rem;
  color: var(--chalk);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.wordmark .tld { color: var(--amber); }
nav.site {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.92rem;
}
nav.site a { color: var(--chalk-muted); text-decoration: none; }
nav.site a:hover { color: var(--amber); }
button.theme {
  background: none;
  border: 1px solid var(--obsidian-border);
  border-radius: 999px;
  color: var(--chalk-muted);
  width: 2rem; height: 2rem;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}
button.theme:hover { color: var(--amber); border-color: var(--amber-dim); }

/* ── article ── */
article h1 {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  line-height: 1.45;
  margin: 0 0 1rem;
  color: var(--chalk);
}
.byline {
  color: var(--chalk-muted);
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}
.byline b { color: var(--amber); font-weight: 500; }
.excerpt {
  color: var(--chalk-muted);
  font-size: 1rem;
  border-inline-start: 2px solid var(--amber-dim);
  padding-inline-start: 1rem;
  margin: 1.6rem 0 2.6rem;
}
article h2 {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.6;
  margin: 2.8rem 0 0.9rem;
  color: var(--amber);
}
article h3 {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: 1.2rem;
  margin: 2.4rem 0 0.8rem;
  color: var(--chalk);
}
article p { margin: 0 0 1.25rem; }
article strong { color: var(--chalk); }
article a { color: var(--amber); text-decoration: none; border-bottom: 1px solid var(--amber-glow); }
article a:hover { border-bottom-color: var(--amber); }
article ul, article ol { padding-inline-start: 1.6rem; margin: 0 0 1.25rem; }
article li { margin-bottom: 0.55rem; }
article li::marker { color: var(--amber-dim); }
article hr {
  border: none;
  border-top: 1px solid var(--obsidian-border);
  margin: 3rem auto;
  width: 38%;
}
article hr + h3 + ol, .sources ol { font-size: 0.9rem; color: var(--chalk-muted); }
span[dir="ltr"] { unicode-bidi: isolate; white-space: nowrap; }

/* ── index ── */
.site-title {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 0.4rem;
}
.site-sub { color: var(--chalk-muted); margin: 0 0 3rem; }
.entry {
  display: block;
  border: 1px solid var(--obsidian-border);
  border-radius: 10px;
  background: var(--obsidian-elevated);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.4rem;
}
.entry h2 {
  font-family: var(--display-font);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.6;
  margin: 0 0 0.6rem;
}
.entry h2 a { color: var(--chalk); text-decoration: none; }
.entry h2 a:hover { color: var(--amber); }
.entry p { color: var(--chalk-muted); font-size: 0.95rem; margin: 0 0 1rem; }
.entry .langs { font-size: 0.9rem; }
.entry .langs a { color: var(--amber); text-decoration: none; margin-inline-end: 1.1rem; }
.entry .langs a:hover { text-decoration: underline; }
.entry .date { color: var(--chalk-muted); font-size: 0.85rem; float: inline-end; }

footer.site {
  border-top: 1px solid var(--obsidian-border);
  margin-top: 4rem;
  padding: 1.4rem 0 2.2rem;
  color: var(--chalk-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
footer.site a { color: var(--chalk-muted); text-decoration: none; }
footer.site a:hover { color: var(--amber); }

@media (max-width: 480px) {
  body { font-size: 1rem; }
  header.site { margin-bottom: 2.2rem; }
}

/* ── owner editor ── */
button.edit-pencil {
  background: none;
  border: none;
  color: var(--chalk-muted);
  opacity: 0.45;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 0.2rem;
}
button.edit-pencil:hover { opacity: 1; color: var(--amber); }
.edit-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 50;
  background: var(--obsidian-elevated);
  border-top: 1px solid var(--obsidian-border);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 62vh;
}
.edit-panel .edit-pass {
  background: var(--obsidian);
  border: 1px solid var(--obsidian-border);
  border-radius: 6px;
  color: var(--chalk);
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  max-width: 20rem;
}
.edit-panel .edit-ta {
  flex: 1;
  background: var(--obsidian);
  border: 1px solid var(--obsidian-border);
  border-radius: 6px;
  color: var(--chalk);
  font-family: var(--body-font);
  font-size: 0.98rem;
  line-height: 1.8;
  padding: 0.8rem 1rem;
  resize: none;
}
.edit-panel .edit-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.edit-panel button {
  background: var(--obsidian);
  border: 1px solid var(--obsidian-border);
  border-radius: 6px;
  color: var(--chalk);
  padding: 0.4rem 1rem;
  font-size: 0.92rem;
  cursor: pointer;
}
.edit-panel button.edit-save { border-color: var(--amber-dim); color: var(--amber); }
.edit-panel button:hover { border-color: var(--amber); }
.edit-panel .edit-msg { color: var(--chalk-muted); font-size: 0.88rem; }
