/* mohammedridwan.com — paper #F9F6E8, evergreen #193627, flame #FF4100, fawn #D5BF86, chiffon #F1F0CC */

@font-face { font-family: 'ET Book'; src: url('/assets/fonts/et-book-roman.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'ET Book'; src: url('/assets/fonts/et-book-italic.woff') format('woff'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'ET Book'; src: url('/assets/fonts/et-book-bold.woff') format('woff'); font-weight: 600; font-style: normal; font-display: swap; }

html, body {
  margin: 0;
  padding: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.16 0 0 0 0.11 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E") repeat,
    #F9F6E8;
}
body { font-family: 'ET Book', Palatino, Georgia, serif; color: #193627; }
a { color: #193627; text-decoration: none; }
a:hover { color: #FF4100; }
::selection { background: #FF4100; color: #F1F0CC; }
[hidden] { display: none !important; }

/* paper grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.36 0 0 0 0 0.24 0 0 0 0.45 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
}

@keyframes tapRipple {
  0% { transform: translate(-50%, -50%) scale(0.25); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- frame ---- */
.frame {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border: 14px solid #193627;
  box-sizing: border-box;
  animation: pageIn 0.5s ease 0.06s backwards;
}
@media (max-width: 640px) { .frame { border: none; } }
html.is-mobile .frame { border: none; }

/* ---- nav ---- */
.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(72px, 12vh, 120px) 24px 0;
}
.nav .spacer { flex: 1; }
.nav .nav-break { order: -1; flex-basis: 0; height: 0; }
@media (max-width: 640px) {
  .nav .spacer { display: none; }
  .nav .nav-break { flex-basis: 100%; }
  .nav .pill-group { order: -2; }
}
html.is-mobile .nav .spacer { display: none; }
html.is-mobile .nav .nav-break { flex-basis: 100%; }
html.is-mobile .nav .pill-group { order: -2; }

.pill {
  font-size: 19px;
  line-height: 1;
  white-space: nowrap;
  padding: 10px 20px 12px;
  border-radius: 999px;
  color: #193627;
  background: #F8F7E4;
  border: 1px solid rgba(25, 54, 39, 0.18);
  box-shadow: 0 1px 3px rgba(25, 54, 39, 0.18), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  transition: all 0.2s ease;
}
.pill:hover {
  color: #FF4100;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(25, 54, 39, 0.22), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}
.pill:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px rgba(25, 54, 39, 0.2);
}
.pill.current {
  color: #FF4100;
  background: #E9E7C4;
  box-shadow: inset 0 2px 5px rgba(25, 54, 39, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(1px);
}

.menu { position: relative; }
.menu-toggle { display: flex; align-items: center; gap: 8px; }
.chev { font-size: 11px; transition: transform 0.2s; }
.menu.open .chev { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 230px;
  max-width: calc(100vw - 72px);
  background: #F8F7E4;
  border: 1px solid rgba(25, 54, 39, 0.18);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(25, 54, 39, 0.18);
}
.dropdown-wide { min-width: 320px; }
.dropdown-label {
  font-style: italic;
  font-size: 15px;
  color: #193627;
  opacity: 0.65;
  padding: 6px 14px 2px;
}
.dropdown-label.tail { padding: 4px 14px 8px; }
.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 18px;
  padding: 8px 14px;
  border-radius: 9px;
  color: #193627;
}
a.dropdown-item:hover { background: rgba(25, 54, 39, 0.06); color: #FF4100; }
.dropdown-item.row { justify-content: flex-start; }
.dropdown-item .grow { flex: 1; }
.dropdown-item .fav { border-radius: 4px; flex: 0 0 auto; }
.dropdown-item .ext { opacity: 0.55; flex: 0 0 auto; }
.dropdown-item.redacted { opacity: 0.45; }
.dropdown-item .swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(25, 54, 39, 0.15);
  flex: 0 0 auto;
}
.dropdown-sep { height: 1px; background: rgba(25, 54, 39, 0.14); margin: 6px 8px; }
.dropdown-note {
  font-size: 13px;
  line-height: 1.55;
  color: #193627;
  opacity: 0.85;
  margin: 0;
  padding: 0 14px 10px;
}
.dropdown-note a { color: #FF4100; text-decoration: underline; }

.pill-group {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: 999px;
  background: #F8F7E4;
  border: 1px solid rgba(25, 54, 39, 0.18);
  box-shadow: 0 1px 3px rgba(25, 54, 39, 0.18), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  overflow: hidden;
  padding: 3px;
}
.seg {
  display: flex;
  align-items: center;
  font-size: 19px;
  line-height: 1;
  white-space: nowrap;
  padding: 7px 16px 9px;
  border-radius: 999px;
  color: #193627;
  transition: all 0.2s ease;
}
.seg:hover { color: #FF4100; background: rgba(25, 54, 39, 0.05); }
.seg:active {
  box-shadow: inset 0 2px 4px rgba(25, 54, 39, 0.28);
  transform: scale(0.96);
  background: rgba(25, 54, 39, 0.08);
}
.seg.current {
  background: rgba(25, 54, 39, 0.09);
  box-shadow: inset 0 2px 5px rgba(25, 54, 39, 0.28), inset 0 -1px 0 rgba(255, 255, 255, 0.5);
  color: #FF4100;
}
.seg.icon { justify-content: center; width: 42px; padding: 0; }
.seg.glyph { font-size: 16px; font-weight: 500; }

/* ---- content ---- */
.content {
  flex: 1;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(52px, 9vh, 84px) 24px 0;
  position: relative;
  z-index: 1;
}

/* ---- letter ---- */
.letter {
  font-size: clamp(20px, 5vw, 23px);
  line-height: 1.7;
  color: #193627;
}
.letter p { margin: 0 0 22px; }
.letter .greeting {
  font-size: clamp(28px, 7vw, 34px);
  line-height: 1.2;
}
.about-photo {
  width: 100%;
  height: auto;
  display: block;
  margin: 6px 0 26px;
  border-radius: 6px;
  border: 1px solid rgba(25, 54, 39, 0.2);
  box-shadow: 0 2px 12px rgba(25, 54, 39, 0.14);
  box-sizing: border-box;
}
.flame { color: #FF4100; }
.nowrap { white-space: nowrap; }
.inline-fav {
  border-radius: 3px;
  vertical-align: baseline;
  margin-right: 4px;
  transform: translateY(1px);
}
.inline-face {
  border-radius: 999px;
  object-fit: cover;
  vertical-align: baseline;
  margin-right: 4px;
  transform: translateY(2px);
}
.letter .on-people {
  font-weight: 400;
  font-size: 20px;
  color: #FF4100;
}
.letter .signature {
  margin: 0;
  font-style: italic;
  font-size: 22px;
  color: #FF4100;
}

/* ---- writing ---- */
.page-title {
  font-size: clamp(28px, 7vw, 34px);
  font-weight: 400;
  color: #193627;
  margin: 0 0 18px;
}
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; }
.chip {
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px 9px;
  border-radius: 999px;
  color: #193627;
  background: #F8F7E4;
  border: 1px solid rgba(25, 54, 39, 0.18);
  box-shadow: 0 1px 2px rgba(25, 54, 39, 0.12);
  transition: all 0.2s ease;
}
.chip:hover { color: #FF4100; border-color: rgba(255, 65, 0, 0.5); transform: translateY(-1px); }
.chip:active { transform: translateY(1px); box-shadow: inset 0 1px 3px rgba(25, 54, 39, 0.2); }

.topic-sections { display: flex; flex-direction: column; gap: 44px; }
.topic-heading {
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  color: #FF4100;
  margin: 0 0 8px;
}
.essay-list { display: flex; flex-direction: column; }
.essay-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 20px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(25, 54, 39, 0.14);
  color: #193627;
  transition: color 0.25s, padding-left 0.25s;
}
.essay-row:hover { color: #FF4100; padding-left: 10px; }
.essay-title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(18px, 4.6vw, 21px);
  line-height: 1.3;
}
.badge-popular {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #FF4100;
  background: rgba(255, 65, 0, 0.09);
  border: 1px solid rgba(255, 65, 0, 0.45);
  border-radius: 999px;
  padding: 4px 9px 5px;
  white-space: nowrap;
  transform: translateY(-2px);
}
.essay-date {
  font-size: 13px;
  color: #193627;
  opacity: 0.55;
  white-space: nowrap;
}

/* ---- reading ---- */
.page-title.tight { margin: 0 0 8px; }
.page-sub {
  font-size: 15px;
  color: #193627;
  opacity: 0.65;
  margin: 0 0 36px;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 22px;
}
.book-card {
  background: #F8F7E4;
  border: 1px solid rgba(25, 54, 39, 0.14);
  border-radius: 14px;
  padding: 30px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 1px 3px rgba(25, 54, 39, 0.08);
}
.book-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 250px;
  perspective: 900px;
}
.book {
  position: relative;
  width: 148px;
  height: 218px;
  transform-style: preserve-3d;
  transform: rotateY(-28deg) rotateX(2deg);
  transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1);
}
.book:hover { transform: rotateY(-12deg) rotateX(1deg) translateY(-5px) scale(1.04); }
.book-back {
  position: absolute;
  inset: 0;
  transform: translateZ(-12px);
  background: linear-gradient(160deg, #17301F, #0E2015);
  border-radius: 3px 8px 8px 3px;
  box-shadow: 18px 16px 32px rgba(25, 54, 39, 0.18), 6px 5px 10px rgba(25, 54, 39, 0.12);
}
.book-pages {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: calc(100% - 12px);
  width: 24px;
  transform: rotateY(90deg);
  border-radius: 1px;
  background: linear-gradient(180deg, #EFEBD2 0%, #F7F4E2 8%, #F2EED8 92%, #E4DFC2 100%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 1px, rgba(120, 105, 70, 0.35) 1.5px, rgba(0, 0, 0, 0) 2px);
  background-blend-mode: multiply;
}
.book-top {
  position: absolute;
  left: calc(100% - 12px);
  top: 0;
  width: 24px;
  height: 6px;
  transform: rotateY(90deg) rotateX(90deg) translateZ(-3px);
  background: #EDE9CF;
  opacity: 0.9;
}
.book-front {
  position: absolute;
  inset: 0;
  transform: translateZ(12px);
  background: #193627;
  border-radius: 3px 8px 8px 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  box-sizing: border-box;
}
.book-front .spine-title {
  font-size: 17px;
  line-height: 1.25;
  color: #F1F0CC;
  text-align: center;
}
.book-front .spine-author {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #D5BF86;
  text-align: center;
}
.book-cover-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.book-gloss {
  position: absolute;
  inset: 0;
  border-radius: 3px 8px 8px 3px;
  background: linear-gradient(102deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 16%, rgba(255, 255, 255, 0) 32%, rgba(0, 0, 0, 0.05) 62%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
}
.book-meta { display: flex; flex-direction: column; gap: 4px; }
.book-meta .b-title {
  font-size: 21px;
  line-height: 1.25;
  color: #193627;
}
.book-meta .b-author {
  font-style: italic;
  font-size: 13px;
  color: #193627;
  opacity: 0.6;
}
.book-meta .b-review {
  font-size: 13.5px;
  line-height: 1.6;
  color: #193627;
  opacity: 0.85;
  margin: 8px 0 0;
}

/* ---- article ---- */
.back-link { font-size: 19px; color: #193627; opacity: 0.75; }
.back-link:hover { color: #FF4100; opacity: 1; }
.article-title {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 400;
  color: #193627;
  line-height: 1.15;
  margin: 22px 0 8px;
}
.article-date {
  font-size: 14px;
  color: #193627;
  opacity: 0.55;
  margin-bottom: 34px;
}
.article-body { display: flex; flex-direction: column; gap: 18px; }
.article-body strong { font-weight: 600; }
.blk-p, .blk-h, .blk-q, .blk-note { line-height: 1.6; color: #193627; margin: 0; }
.blk-p { font-size: clamp(19px, 4.8vw, 21px); }
.blk-h { font-size: clamp(22px, 5.6vw, 26px); margin-top: 14px; }
.blk-q {
  font-size: clamp(19px, 4.8vw, 21px);
  font-style: italic;
  opacity: 0.9;
  padding: 0 0 0 18px;
  border-left: 2px solid #FF4100;
}
.blk-note { font-size: 15px; opacity: 0.6; margin-top: 8px; }
.blk-li { display: flex; gap: 12px; align-items: baseline; padding-left: 6px; }
.blk-li .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #FF4100;
  flex: 0 0 auto;
  transform: translateY(-2px);
}
.blk-li p {
  font-size: clamp(18px, 4.6vw, 20px);
  line-height: 1.65;
  color: #193627;
  margin: 0;
  flex: 1;
}
.blk-video {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(25, 54, 39, 0.16);
  margin: 8px 0;
}
.blk-video iframe { width: 100%; height: 100%; border: none; display: block; }
.blk-image {
  aspect-ratio: 16 / 6;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(25, 54, 39, 0.16);
  margin: 8px 0;
  background-size: cover;
  background-position: center;
}

/* ---- footer ---- */
.footer-wrap { position: relative; z-index: 0; margin-top: 40px; }
.mosaic {
  display: flex;
  flex-direction: column;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0.85) 55%, black 68%, black 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.35) 30%, rgba(0, 0, 0, 0.85) 55%, black 68%, black 100%);
}
.mosaic-row { display: flex; }
.mosaic-cell { aspect-ratio: 1; flex: 1 0 auto; }
shader-footer { height: 220px; }
