/* husamsaoudi.com — shared styles
   Palette carries over the original site's crimson, gold and tan. */

:root {
  --crimson: #8e1116;
  --crimson-deep: #6c0b10;
  --gold: #f2b632;
  --ink: #221517;
  --ink-soft: #5b4a4c;
  --paper: #f6f3f2;
  --surface: #ffffff;
  --sand: #d9c9b3;
  --rule: #e2d8d4;
  --link: #8e1116;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-verse: "Literata", Georgia, "Times New Roman", serif;
  --font-arabic: "Noto Naskh Arabic", "Traditional Arabic", "Geeza Pro", serif;

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --crimson: #7a0e13;
    --crimson-deep: #560a0d;
    --ink: #efe6e3;
    --ink-soft: #bba9a6;
    --paper: #171011;
    --surface: #221819;
    --sand: #4a3a33;
    --rule: #3a2c2d;
    --link: #f2b632;
  }
}

*, *::before, *::after { box-sizing: inherit; }

html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 1rem); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--gold); color: #221517; padding: .6rem 1rem; font-weight: 600;
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.prose { max-width: 38rem; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 36rem; }

/* ---------- Site header ---------- */
.site-header { background: var(--crimson); color: #fbf3ef; }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 2rem; padding-block: 1rem;
}
.wordmark {
  font: 800 1.25rem/1 var(--font-display); letter-spacing: -0.03em;
  color: #fbf3ef; text-decoration: none;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.site-nav a {
  color: #fbf3ef; text-decoration: none; font-weight: 600; font-size: .98rem;
  padding-block: .35rem; border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: rgba(251, 243, 239, .5); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--gold); }

/* ---------- Page heading band (inner pages) ---------- */
.page-head { background: var(--crimson); color: #fbf3ef; padding-block: clamp(2rem, 6vw, 4rem) clamp(2.25rem, 6vw, 4.25rem); }
.page-head h1 {
  font-size: clamp(2.6rem, 8vw, 5.5rem); font-weight: 800; letter-spacing: -0.045em;
  line-height: .95; margin: 0; max-width: 16ch;
}
.page-head p { margin: 1rem 0 0; max-width: 36rem; color: #f0d9d3; font-size: 1.1rem; }
.page-head a { color: var(--gold); }
.back { display: inline-block; margin-bottom: 1.25rem; font-weight: 600; font-size: .95rem; }

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { padding-top: 0; }

/* ---------- Home ---------- */
.hero { background: var(--crimson); color: #fbf3ef; padding-top: clamp(2rem, 7vw, 5rem); }
.hero h1 {
  font-size: clamp(3.75rem, 15vw, 11rem); font-weight: 800; letter-spacing: -0.055em;
  line-height: .84; margin: 0; text-wrap: balance;
}
.hero .tagline { font-size: clamp(1.1rem, 2.2vw, 1.35rem); max-width: 34rem; margin: 1.5rem 0 0; color: #f0d9d3; }

/* the artwork strip straddles the crimson/paper edge */
.strip {
  display: flex; gap: .75rem; margin-top: clamp(2rem, 5vw, 3.5rem);
  position: relative; top: 4rem; margin-bottom: 4rem;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .25rem;
  scrollbar-width: thin;
}
.strip a { flex: 0 0 auto; scroll-snap-align: start; }
.strip img {
  height: clamp(9rem, 20vw, 14rem); width: auto; aspect-ratio: auto;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
@media (prefers-reduced-motion: no-preference) {
  .strip a { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .strip a:nth-child(2) { animation-delay: .06s; }
  .strip a:nth-child(3) { animation-delay: .12s; }
  .strip a:nth-child(4) { animation-delay: .18s; }
  .strip a:nth-child(5) { animation-delay: .24s; }
  .strip a:nth-child(6) { animation-delay: .30s; }
  @keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } }
}

.welcome { padding-top: clamp(6rem, 12vw, 8rem); }
.welcome .grid { display: grid; gap: 2.5rem 4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.welcome h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }

.destinations { list-style: none; margin: 0; padding: 0; }
.destinations li { border-top: 1px solid var(--rule); }
.destinations li:last-child { border-bottom: 1px solid var(--rule); }
.destinations a {
  display: block; padding: 1rem 0; text-decoration: none; color: var(--ink);
}
.destinations a strong { display: block; font: 800 1.3rem/1.2 var(--font-display); letter-spacing: -0.02em; }
.destinations a span { color: var(--ink-soft); font-size: .98rem; }
.destinations a:hover strong { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }

/* ---------- Gallery hub ---------- */
.hub { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.hub a { color: var(--ink); text-decoration: none; display: block; }
.hub img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hub h2 { font-size: 1.5rem; margin: 1rem 0 .25rem; }
.hub p { color: var(--ink-soft); margin: 0; }
.hub a:hover h2 { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }

/* ---------- Image gallery (masonry) ---------- */
.masonry { columns: 3 17rem; column-gap: 1rem; }
.masonry figure { margin: 0 0 1rem; break-inside: avoid; }
.zoom {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  color: inherit;
}
.zoom img { width: 100%; }

/* ---------- Apps & games ---------- */
.shots { display: grid; gap: 2.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.shots figure { margin: 0; }
.shots img { border: 1px solid var(--rule); }
figcaption { font-size: .92rem; color: var(--ink-soft); margin-top: .6rem; }

/* ---------- Cartoons ---------- */
.show-index { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem .5rem; }
.show-index a {
  display: inline-block; padding: .35rem .75rem; border: 1px solid var(--sand);
  border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .95rem;
}
.show-index a:hover { border-color: var(--link); color: var(--link); }

.show { padding-block: 2.5rem; border-top: 1px solid var(--rule); }
.show-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin-bottom: .25rem; }
.show-title h2 { margin: 0; }
.ar { font-family: var(--font-arabic); font-weight: 500; font-size: 1.55rem; line-height: 1.4; color: var(--link); }
.show .meta { color: var(--ink-soft); margin: .25rem 0 1.25rem; }
.frames { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.frames figure { margin: 0; }
.frames img { height: min(12.5rem, var(--h)); width: auto; }
.frames figcaption { text-align: center; margin-top: .3rem; font-size: .85rem; }
.featured-frame img { height: min(24rem, var(--h)); }

/* ---------- Poems ---------- */
.poem-index { list-style: none; padding: 0; margin: 0; }
.poem-index li { margin-bottom: .35rem; }
.poem { padding-block: 3rem; border-top: 1px solid var(--rule); }
.poem h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .25rem; }
.poem .byline { color: var(--ink-soft); margin: 0 0 2rem; }
.verse { font-family: var(--font-verse); font-size: 1.12rem; line-height: 1.75; }
.verse p { margin: 0 0 1.6em; }
.verse .indent { padding-left: 2em; display: inline-block; }
.poem .signature { font-family: var(--font-verse); font-style: italic; color: var(--ink-soft); }

/* ---------- About ---------- */
.about { display: grid; gap: 2.5rem 4rem; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: start; }
@media (max-width: 44rem) { .about { grid-template-columns: 1fr; } .about .portrait { max-width: 12rem; } }
.portrait img { width: 100%; background: #f6f3f2; image-rendering: pixelated; }
.facts { margin: 0; display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 0; }
.facts dt, .facts dd { padding: 1rem 0; border-top: 1px solid var(--rule); margin: 0; }
.facts dt { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; padding-right: 1rem; }
.facts dd + dd { border-top: 0; padding-top: 0; grid-column: 2; }
@media (max-width: 34rem) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { border-top: 0; padding-top: 0; }
  .facts dd + dd { grid-column: 1; }
}

/* ---------- Resume ---------- */
.resume { display: grid; gap: 3rem; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); align-items: start; }
@media (max-width: 52rem) { .resume { grid-template-columns: 1fr; gap: 2rem; } }
.resume-aside { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1.5rem); }
@media (max-width: 52rem) { .resume-aside { position: static; } }
.resume-aside h2 { font-size: 1.1rem; margin-bottom: .75rem; }
.resume-aside ul { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.resume-aside li { margin-bottom: .4rem; }
.button {
  display: inline-block; font: 600 .95rem/1 var(--font-body); color: var(--ink);
  background: transparent; border: 1px solid var(--sand); padding: .6rem .9rem; border-radius: 6px; cursor: pointer;
}
.button:hover { border-color: var(--link); color: var(--link); }
.resume section { margin-bottom: 3rem; }
.resume section > h2 { padding-bottom: .5rem; border-bottom: 2px solid var(--crimson); }
.job { padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.job:last-child { border-bottom: 0; }
.job h3 { margin-bottom: .15rem; }
.job .where { color: var(--ink-soft); margin-bottom: .6rem; }
.job .when { font-variant-numeric: tabular-nums; }
.job p:last-child { margin-bottom: 0; }
.skills { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.skills li { border: 1px solid var(--rule); background: var(--surface); padding: .2rem .6rem; border-radius: 4px; font-size: .92rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--crimson-deep); color: #f0d9d3; margin-top: clamp(3rem, 8vw, 6rem); font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-block: 2rem; }
.site-footer a { color: #fbf3ef; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer p { margin: 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.lightbox::backdrop { background: rgba(20, 8, 9, .92); }
.lightbox .stage {
  width: 100%; height: 100%; display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 3.5rem) 3.5rem calc(env(safe-area-inset-bottom, 0px) + 3.5rem);
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); width: auto; height: auto; object-fit: contain; }
.lightbox .caption { color: #f0d9d3; text-align: center; margin-top: .75rem; font-size: .95rem; }
.lightbox button {
  position: absolute; background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.3);
  width: 2.75rem; height: 2.75rem; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.lightbox button:hover { background: var(--crimson); }
.lightbox .close { top: calc(env(safe-area-inset-top, 0px) + 1rem); right: 1rem; }
.lightbox .prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: .75rem; top: 50%; transform: translateY(-50%); }

/* ---------- Not found ---------- */
.notfound { padding-block: clamp(3rem, 10vw, 7rem); }

/* ---------- Print (replaces the old printer-friendly resume page) ---------- */
@media print {
  .site-header, .site-footer, .skip, .resume-aside, .back, .lightbox { display: none !important; }
  .page-head { background: none; color: #000; padding: 0 0 1rem; }
  .page-head h1 { font-size: 2rem; }
  .page-head p { color: #333; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .resume { display: block; }
  .job { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
