@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/instrument-serif.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-sans.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f4ec;
  --ink: #20221d;
  --muted: #575a4e;
  --line: #d8d7ca;
  --blue: #244af0;
  --sans: 'Instrument Sans', Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --ease: cubic-bezier(.2, .72, .22, 1);
  --gutter: clamp(18px, 4.8vw, 70px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding: 98px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--sans); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
::selection { color: white; background: var(--blue); }

.shell { max-width: 1440px; padding-inline: var(--gutter); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 10;
  inset-block-start: 14px;
  inset-inline-start: 14px;
  padding: .6rem 1rem;
  background: var(--paper);
}

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 3;
  background: #f7f4ecf1;
  border-block-end: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; }
.brand-mark { width: 19px; height: 17px; position: relative; margin-inline-end: 1px; color: var(--blue); }
.brand-mark::before, .brand-mark::after {
  content: '';
  position: absolute;
  border: 1.5px solid;
  border-radius: 2px;
  inset: 0 3px 3px 0;
  transform: rotate(-12deg);
}
.brand-mark::after { inset: 4px 0 0 3px; background: currentColor; transform: rotate(8deg); }
.profile { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 4px 14px; font-size: .86rem; font-weight: 600; }
.profile span + span, .profile bdi + span { color: var(--muted); }

.picker { padding-block: clamp(34px, 5vh, 71px) clamp(30px, 8vh, 92px); }
.picker-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 28px;
  margin-block-end: clamp(20px, 4vh, 42px);
  animation: reveal .62s var(--ease) both;
}

.picker h1 { font: 400 clamp(64px, 8vw, 120px)/.89 var(--serif); letter-spacing: -.047em; }
.picker h1 span { color: var(--blue); }

#subject-search { flex: 0 1 275px; }
#subject-search label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #fffcf5;
}
#subject-search label:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
#subject-search input { width: 100%; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; font: inherit; }
#subject-search input::placeholder { color: var(--muted); opacity: 1; }
.search-icon { position: relative; width: 13px; height: 13px; flex: none; border: 1.5px solid var(--muted); border-radius: 50%; margin-inline-end: 2px; }
.search-icon::after { content: ''; position: absolute; width: 6px; height: 1.5px; background: var(--muted); inset: 10px auto auto 8px; transform: rotate(45deg); }

.subject-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--tile-ink);
  background: var(--tile-bg);
  border-radius: 11px;
}

.theme-english {
  --tile-solid: #263dd4;
  --tile-bg: radial-gradient(ellipse at 76% 40%, #405bf0, #263dd4 65%, #202f96);
  --tile-ink: #fff9ee;
  --art-ink: #bbc5ff;
  --art-line: #eadfff7a;
}
.theme-arabic {
  --tile-solid: #7c2e22;
  --tile-bg: radial-gradient(ellipse at 78% 34%, #aa5337, #833623 64%, #62281e);
  --tile-ink: #fff0df;
  --art-ink: #f8bb8d;
  --art-line: #ffe1c66e;
}
.theme-social-studies {
  --tile-solid: #ae7b23;
  --tile-bg: radial-gradient(ellipse at 77% 32%, #e8d08c, #c99541 72%, #b6812e);
  --tile-ink: #261b0d;
  --art-ink: #493315;
  --art-line: #4d351c62;
}
.theme-islamic-education {
  --tile-solid: #235746;
  --tile-bg: radial-gradient(ellipse at 77% 34%, #3c775d, #205443 67%, #163b32);
  --tile-ink: #fff7df;
  --art-ink: #b8dbaa;
  --art-line: #eef7c773;
}

.subject-art {
  position: absolute;
  z-index: -1;
  inset-inline-end: 1.7%;
  inset-block-start: 50%;
  width: min(53%, 350px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--art-ink);
  translate: 0 -50%;
  opacity: .72;
  pointer-events: none;
  mask-image: linear-gradient(to right, #0004, #000 37%);
}
[dir="rtl"] .subject-art { mask-image: linear-gradient(to left, #0004, #000 37%); }
.art-orbit, .art-form { display: block; grid-area: 1 / 1; }
.art-orbit {
  width: 88%;
  aspect-ratio: 1;
  border: 1px solid var(--art-line);
  border-radius: 50%;
  transform: rotate(-22deg) scaleY(.78);
  animation: orbit-reveal 1.12s var(--delay, .18s) var(--ease) both;
  transition: transform .7s var(--ease);
}
.art-orbit-secondary { width: 70%; transform: rotate(24deg) scaleY(.8); }
.art-form {
  display: grid;
  place-items: center;
  line-height: .8;
  transition: transform .66s var(--ease);
  animation: art-reveal 1.1s var(--delay, .18s) var(--ease) both;
}
.theme-english { --art-transition: english-art; }
.theme-arabic { --art-transition: arabic-art; }
.theme-social-studies { --art-transition: social-art; }
.theme-islamic-education { --art-transition: islamic-art; }
.theme-english .art-form { font: 400 clamp(132px, 21vw, 330px)/.65 var(--serif); translate: 0 16%; }
.theme-arabic .art-form { font: 400 clamp(125px, 17vw, 280px)/.9 Georgia, 'Times New Roman', serif; translate: 2% -13%; }
.theme-social-studies .art-form {
  width: 40%;
  aspect-ratio: 1;
  border: 1px solid var(--art-line);
  transform: rotate(45deg);
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, var(--art-line) 11px 12px),
    repeating-linear-gradient(0deg, transparent 0 11px, var(--art-line) 11px 12px);
}
.theme-social-studies .art-form::after { content: ''; width: 29%; aspect-ratio: 1; background: currentColor; transform: rotate(45deg); }
.theme-social-studies .subject-art { inset-block-start: 43%; }
.theme-islamic-education .art-form { width: 46%; }
.moon-and-star, .theme-islamic-education .art-form {
  display: block;
  position: relative;
  aspect-ratio: 1;
}
.moon-and-star::before, .theme-islamic-education .art-form::before {
  content: '';
  position: absolute;
  inset: 8% 20% 11% 0;
  border-radius: 50%;
  background: currentColor;
  mask-image: radial-gradient(ellipse at 77% 30%, transparent 57%, black 58%);
  transform: rotate(-12deg);
}
.moon-and-star::after, .theme-islamic-education .art-form::after {
  content: '';
  position: absolute;
  inset: 13% 3% auto auto;
  width: 24%;
  aspect-ratio: 1;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 69% 57%, 80% 92%, 50% 71%, 20% 92%, 31% 57%, 2% 35%, 39% 34%);
}
.no-results { padding: 24px 0; color: var(--muted); }

.subject-layout { padding-block: clamp(20px, 4vh, 50px) 60px; }
.crumb { margin-block-end: 15px; }
.crumb a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
}
[dir="rtl"] .crumb a { padding: 6px 0 6px 10px; }
.crumb a:hover { color: var(--blue); }
.subject-cover {
  display: flex;
  align-items: end;
  min-height: clamp(165px, 32vh, 325px);
  padding: clamp(22px, 4.25vw, 60px);
  animation: reveal .66s var(--ease) both;
}
.subject-cover .subject-art { width: min(61%, 435px); inset-inline-end: 4%; }
.subject-cover h1 { font: 400 clamp(60px, 10vw, 132px)/.88 var(--serif); letter-spacing: -.045em; }
[dir="rtl"] .subject-cover h1 { font: 700 clamp(35px, 7.8vw, 102px)/1.12 var(--sans); letter-spacing: 0; }
.subject-cover h1 small { display: block; margin-block-start: .4em; font: 600 1.04rem/1.4 var(--sans); letter-spacing: 0; }
.subject-body { max-width: 960px; margin-inline: auto; animation: reveal .7s .12s var(--ease) both; }
.subject-body h2 { margin-block-end: 12px; font-size: 1.18rem; font-weight: 660; }
.work-section, .brief, .other-subjects { margin-block-start: clamp(24px, 4.5vw, 53px); }
.work-card {
  display: grid;
  grid-template-columns: 45px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: clamp(13px, 2vw, 23px);
  min-height: 106px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffcf5;
}
.work-card h3 { font-size: 1.06rem; font-weight: 660; }
.work-status { margin-block-start: 2px; color: var(--muted); font-size: .9rem; }
.file-icon {
  align-self: start;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  color: var(--tile-solid);
  background: color-mix(in srgb, var(--tile-solid) 12%, #fffcf5);
}
.file-icon::before { content: ''; width: 13px; height: 17px; border: 1.5px solid; border-radius: 2px; }
.web-icon::before { width: 17px; height: 14px; border-top-width: 4px; }
.work-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .68rem .95rem;
  border-radius: 100px;
  background: var(--tile-solid);
  color: var(--tile-ink);
  text-decoration: none;
  font-size: .87rem;
  font-weight: 650;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.theme-social-studies .work-link { --tile-solid: #b17c26; }
.work-link:hover { transform: translateY(-2px); box-shadow: 0 5px 12px #171b192e; }

.mark-card {
  display: grid;
  justify-items: start;
  gap: 12px;
  width: max-content;
  max-width: 100%;
  padding: clamp(10px, 2vw, 17px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffcf5;
  font-size: .88rem;
  font-weight: 600;
  text-underline-offset: .2em;
}
.mark-card img {
  display: block;
  width: clamp(240px, 34vw, 330px);
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.brief-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
}
.brief-list li { padding: clamp(13px, 2.3vw, 24px); background: #fffcf5; }
.brief-list h3 { font-size: .99rem; margin-block-end: 4px; }
.brief-list p { font-size: .93rem; color: var(--muted); }
.other-subjects { border-block-start: 1px solid var(--line); padding-block-start: 18px; }
.other-subjects div { display: flex; flex-wrap: wrap; gap: 8px; }
.other-subjects a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: .55rem .85rem;
  font-size: .9rem;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.other-subjects a:hover { border-color: var(--ink); background: white; }

@keyframes reveal {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes orbit-reveal { from { opacity: 0; scale: .63; rotate: -18deg; } }
@keyframes art-reveal { from { opacity: 0; scale: .68; rotate: -8deg; } }
@keyframes page-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(9px); } }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .subject-art { view-transition-name: var(--art-transition); }
  ::view-transition-group(*) { animation-duration: .42s; animation-timing-function: var(--ease); }
  ::view-transition-old(root) { animation: .22s ease both page-out; }
  ::view-transition-new(root) { animation: .31s var(--ease) both page-in; }
}

@media (max-width: 670px) {
  .header-inner { min-height: 58px; }
  .brand { font-size: .9rem; white-space: nowrap; }
  .profile { gap: 0 7px; font-size: .76rem; }
  .picker { padding-block-start: 24px; }
  .picker-heading { align-items: start; gap: 16px; margin-block-end: 16px; }
  .picker h1 { font-size: clamp(52px, 11vw, 74px); }
  #subject-search { flex: 0 1 240px; font-size: .91rem; }
  .subject-art { width: 82%; inset-inline-end: -7%; inset-block-start: 40%; }
  .theme-english .art-form { font-size: clamp(100px, 26vw, 155px); }
  .theme-arabic .art-form { font-size: clamp(87px, 24vw, 150px); }
  .subject-cover .subject-art { inset-inline-end: -2%; }
  .work-card { grid-template-columns: 37px 1fr; gap: 10px; }
  .file-icon { width: 36px; height: 36px; }
  .work-link { grid-column: 2; justify-self: start; }
}

@media (max-width: 380px) {
  .brief-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .work-link:hover { transform: none; }
}
