/* ============================================================
   Salih Bawarith — Warm Craft Editorial
   Design system + components. Bilingual EN/AR, RTL-aware via
   CSS logical properties.
   ============================================================ */

:root {
  /* ---- Palette ---- */
  --espresso: #2b1b12;
  --roast: #4a2c1a;
  --copper: #b87333;
  --copper-lt: #ce8b4a;
  --brass: #c9a24b;
  --cream: #f4ece0;
  --cream-2: #f8f2e9;
  --oat: #e7d8c3;
  --latte: #dac7a8;
  --ink-blue: #3e4a5b; /* cool contrast for the art track */
  --sage: #6b7a6e;

  /* ---- Semantic ---- */
  --bg: var(--cream);
  --surface: var(--cream-2);
  --text: var(--espresso);
  --text-soft: #6a5341;
  --line: #d8c6ab;
  --accent: var(--copper);

  /* ---- Type ---- */
  --serif: "Fraunces", "Amiri", Georgia, serif;
  --sans: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --ar-display: "Aref Ruqaa", "Amiri", serif;

  /* ---- Scale (perfect fourth) ---- */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.33rem, 1.2rem + 0.6vw, 1.6rem);
  --step-2: clamp(1.77rem, 1.5rem + 1.2vw, 2.4rem);
  --step-3: clamp(2.4rem, 1.9rem + 2.4vw, 3.6rem);
  --step-4: clamp(3.1rem, 2.2rem + 4.4vw, 5.6rem);

  --pad-section: clamp(4rem, 10vw, 9rem);
  --wrap: 1180px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Arabic script gets its own display face for headings */
html[lang="ar"] {
  --serif: "Aref Ruqaa", "Amiri", serif;
  --sans: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
}

/* ---- Reset-ish ---- */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Paper grain overlay — fixed, ultra-subtle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
}
p {
  margin: 0 0 1rem;
  max-width: 66ch;
}
a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(100% - 3rem, var(--wrap));
  margin-inline: auto;
}

/* Section scaffolding */
.section {
  padding-block: var(--pad-section);
  position: relative;
}
.section__kicker {
  font-family: var(--sans);
  font-size: var(--step--1);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
html[lang="ar"] .section__kicker {
  letter-spacing: 0.1em;
}
.section__kicker::before {
  content: "◦";
  color: var(--brass);
  font-size: 1.3em;
}
.section__title {
  font-size: var(--step-3);
  margin-bottom: 1.4rem;
  max-width: 20ch;
}
.section__lead {
  font-size: var(--step-1);
  color: var(--text-soft);
  max-width: 52ch;
  font-family: var(--serif);
  font-style: italic;
}
html[lang="ar"] .section__lead {
  font-style: normal;
}

/* Language visibility toggle.
   Robust pattern: force-hide only the INACTIVE language so the active element
   keeps whatever display a component gives it (inline, flex, block…). This
   survives generic `span {display:…}` component rules that would otherwise leak. */
html[lang="en"] [data-lang="ar"],
html[lang="ar"] [data-lang="en"] {
  display: none !important;
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 2.6rem);
  transition:
    background 0.4s var(--ease),
    backdrop-filter 0.4s;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  backdrop-filter: blur(10px);
  border-block-end: 1px solid var(--line);
}
.brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.brand .glyph {
  color: var(--copper);
  font-family: var(--ar-display);
  font-size: 1.5rem;
  line-height: 1;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.8rem);
}
.nav__links {
  display: flex;
  gap: clamp(0.8rem, 2vw, 1.6rem);
}
.nav__links a {
  text-decoration: none;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  color: var(--text-soft);
  transition: color 0.25s;
}
.nav__links a:hover {
  color: var(--copper);
}
@media (max-width: 760px) {
  .nav__links {
    display: none;
  }
}

.lang-toggle {
  border: 1px solid var(--copper);
  background: transparent;
  color: var(--copper);
  font-family: var(--sans);
  font-size: var(--step--1);
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition:
    background 0.25s,
    color 0.25s;
}
.lang-toggle:hover {
  background: var(--copper);
  color: var(--cream);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding-block: 8rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero__watermark {
  position: absolute;
  inset-inline-end: -4%;
  inset-block-start: 50%;
  transform: translateY(-50%);
  font-family: var(--ar-display);
  font-size: clamp(18rem, 42vw, 40rem);
  color: var(--copper);
  opacity: 0.05;
  line-height: 0.7;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.hero__inner {
  position: relative;
  z-index: 2;
}
.hero__eyebrow {
  font-size: var(--step--1);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 1.6rem;
}
html[lang="ar"] .hero__eyebrow {
  letter-spacing: 0.12em;
}
.hero__name {
  font-size: var(--step-4);
  line-height: 0.98;
  margin-bottom: 0.4rem;
  font-optical-sizing: auto;
}
.hero__name .opmp {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.24em;
  letter-spacing: 0.18em;
  vertical-align: middle;
  color: var(--copper);
  border: 1px solid var(--copper);
  border-radius: 999px;
  padding: 0.3em 0.7em;
  margin-inline-start: 0.6em;
  transform: translateY(-0.35em);
}
.hero__headline {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-1);
  color: var(--text-soft);
  max-width: 34ch;
  margin: 1.4rem 0 2.2rem;
}
html[lang="ar"] .hero__headline {
  font-style: normal;
}

/* Ink-stroke signature under the name */
.hero__sign {
  width: min(420px, 70%);
  height: 70px;
  margin-bottom: 1.6rem;
}
.hero__sign path {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  font-family: var(--sans);
  font-size: var(--step-0);
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.25s var(--ease),
    background 0.25s,
    color 0.25s,
    box-shadow 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn--primary {
  background: var(--espresso);
  color: var(--cream);
}
.btn--primary:hover {
  background: var(--roast);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -12px rgba(43, 27, 18, 0.6);
}
.btn--ghost {
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--copper);
  color: var(--copper);
  transform: translateY(-2px);
}

.hero__meta {
  margin-top: 3.2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: var(--step--1);
  color: var(--text-soft);
  letter-spacing: 0.03em;
}
.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.hero__meta i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brass);
  display: inline-block;
}
.pulse {
  background: #4a8;
  box-shadow: 0 0 0 0 rgba(68, 168, 120, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(68, 168, 120, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(68, 168, 120, 0);
  }
}

/* ============================================================
   Stat band
   ============================================================ */
.statband {
  background: var(--espresso);
  color: var(--cream);
}
.statband .wrap {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .statband .wrap {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 520px) {
  .statband .wrap {
    grid-template-columns: repeat(2, 1fr);
  }
}
.stat {
  text-align: center;
  padding: 0.6rem;
}
.stat__value {
  font-family: var(--serif);
  font-size: var(--step-3);
  color: var(--brass);
  line-height: 1;
}
.stat__label {
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--cream) 80%, transparent);
  margin-top: 0.6rem;
  letter-spacing: 0.02em;
}

/* ============================================================
   About + achievements
   ============================================================ */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
}
.about__body p {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text);
}
.about__body .drop::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  float: inline-start;
  line-height: 0.8;
  padding-inline-end: 0.12em;
  padding-block-start: 0.06em;
  color: var(--copper);
}
html[lang="ar"] .about__body .drop::first-letter {
  float: none;
  font-size: 1em;
  padding: 0;
  color: inherit;
}

.achievements {
  display: grid;
  gap: 1rem;
}
.ach {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--copper);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
}
.ach__metric {
  font-family: var(--serif);
  font-size: var(--step-2);
  color: var(--espresso);
  line-height: 1;
}
.ach__metric small {
  font-size: 0.42em;
  color: var(--copper);
  letter-spacing: 0.08em;
  margin-inline-start: 0.4em;
  font-family: var(--sans);
}
.ach__label {
  color: var(--text-soft);
  margin-top: 0.35rem;
  font-size: var(--step-0);
}
.ach__note {
  font-size: var(--step--1);
  color: var(--sage);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ============================================================
   TIMELINE — roast curve + braided lanes + filters
   ============================================================ */
.timeline {
  background: linear-gradient(180deg, var(--cream) 0%, var(--oat) 100%);
  --tl-label: 150px;
}
@media (max-width: 680px) {
  .timeline {
    --tl-label: 96px;
  }
}
.tl__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.4rem;
}

.tl__filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.chip {
  font-family: var(--sans);
  font-size: var(--step--1);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.28s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c, var(--copper));
}
.chip[aria-pressed="true"] {
  background: var(--espresso);
  color: var(--cream);
  border-color: var(--espresso);
}
.chip:hover {
  border-color: var(--copper);
}

/* The scroll-drawn roast curve — offset by the label column so its
   time-axis aligns exactly with the lane bars and year axis below. */
.roastcurve {
  position: relative;
  margin-inline-start: var(--tl-label);
  width: auto;
  margin-bottom: 0.5rem;
}
.roastcurve svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.roastcurve .curve-line {
  fill: none;
  stroke: var(--copper);
  stroke-width: 3;
  stroke-linecap: round;
}
.roastcurve .curve-fill {
  fill: url(#roastFill);
  opacity: 0.5;
}
.roastcurve .axis {
  stroke: var(--line);
  stroke-width: 1;
}
.roastcurve .axis-label {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--text-soft);
}
.roastcurve .crack {
  fill: var(--ink-blue);
  opacity: 0;
  transition: opacity 0.4s;
}
.roastcurve .crack.on {
  opacity: 0.7;
}

/* Braided lanes */
.lanes {
  position: relative;
  margin-top: 1rem;
}
.lane {
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-label) 1fr;
  gap: 0;
  align-items: center;
  min-height: 64px;
  border-block-start: 1px dashed var(--line);
}
.lane:last-child {
  border-block-end: 1px dashed var(--line);
}
.lane__name {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-inline-end: 1rem;
}
.lane__name .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
  flex: none;
}
.lane__track {
  position: relative;
  height: 100%;
  min-height: 64px;
}

.bar {
  position: absolute;
  inset-block: 14px;
  border-radius: 8px;
  background: var(--c, var(--copper));
  color: #fff;
  display: flex;
  align-items: center;
  padding-inline: 0.7rem;
  font-size: 0.72rem;
  font-family: var(--sans);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px) scaleX(0.6);
  transform-origin: inset-inline-start;
  transition:
    transform 0.5s var(--ease),
    opacity 0.5s var(--ease),
    box-shadow 0.25s,
    filter 0.25s;
  box-shadow: 0 4px 14px -8px rgba(43, 27, 18, 0.5);
}
.bar.in {
  opacity: 1;
  transform: translateY(0) scaleX(1);
}
.bar:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px -8px rgba(43, 27, 18, 0.65);
  z-index: 5;
}
.bar.dim {
  opacity: 0.16 !important;
  filter: grayscale(0.6);
}
.bar__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-inline-end: 0.45rem;
  flex: none;
}
.bar--present::after {
  content: "▸";
  margin-inline-start: 0.35rem;
  opacity: 0.85;
}
.bar--point {
  min-width: 40px;
}
/* let the label shrink and ellipsize inside a narrow bar instead of hard-clipping mid-letter */
.bar__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* chart scroll region (swipeable on narrow screens).
   Force LTR so the curve/bars/years share one left-anchored plot area and
   chronology reads left→right in both languages. Also keeps scrollLeft
   positive and left-anchored in Arabic (RTL) instead of flipping. */
.tl__chart {
  position: relative;
}
.tl__scroll {
  overflow: visible;
  direction: ltr;
}
.tl__inner {
  width: 100%;
  direction: ltr;
}
/* right-edge "more →" gradient — mobile only, fades out at the far end */
.tl__fade {
  display: none;
}
.tl__swipe {
  display: none;
  text-align: center;
  font-size: var(--step--1);
  color: var(--text-soft);
  letter-spacing: 0.1em;
  margin-top: 1rem;
  opacity: 0.7;
}
@media (max-width: 680px) {
  .tl__scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.4rem;
  }
  .tl__inner {
    min-width: 680px;
  }
  .tl__fade {
    display: block;
    position: absolute;
    inset-block: 0;
    right: 0; /* physical: the force-LTR scroller always overflows to the right, both langs */
    width: 48px;
    pointer-events: none;
    background: linear-gradient(to left, var(--bg), transparent);
    transition: opacity 0.3s var(--ease);
  }
  .tl__chart.at-end .tl__fade {
    opacity: 0;
  }
  .tl__swipe {
    display: flex;
    width: fit-content;
    margin-inline: auto; /* centres the fit-content pill */
    align-items: center;
    gap: 0.5rem;
    color: var(--roast);
    opacity: 1;
    background: color-mix(in srgb, var(--copper) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--copper) 28%, transparent);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    letter-spacing: 0.06em;
    transition:
      opacity 0.4s var(--ease),
      transform 0.4s var(--ease);
  }
  .tl__swipe.gone {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
  }
}
.tl__swipe-arrow {
  display: inline-block;
  color: var(--copper);
  font-weight: 700;
}
@media (prefers-reduced-motion: no-preference) {
  .tl__swipe-arrow {
    animation: tl-nudge 1.4s ease-in-out infinite;
  }
  .tl__swipe-arrow--r {
    animation-name: tl-nudge-r;
    animation-delay: 0.7s;
  }
  @keyframes tl-nudge {
    0%,
    100% {
      transform: translateX(0);
      opacity: 0.55;
    }
    50% {
      transform: translateX(-4px);
      opacity: 1;
    }
  }
  @keyframes tl-nudge-r {
    0%,
    100% {
      transform: translateX(0);
      opacity: 0.55;
    }
    50% {
      transform: translateX(4px);
      opacity: 1;
    }
  }
}

/* year gridlines — same plot area as the curve and bars */
.tl__years {
  position: relative;
  height: 26px;
  margin-top: 0.4rem;
  margin-inline-start: var(--tl-label);
}
.tl__year {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-soft);
  font-family: var(--sans);
}
html[dir="rtl"] .tl__year {
  transform: translateX(50%);
}
.tl__grid {
  position: absolute;
  inset-block: 0;
  width: 1px;
  background: var(--line);
  opacity: 0.5;
}

/* Role detail popover */
.tl__detail {
  margin-top: 1.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  min-height: 120px;
  transition: opacity 0.3s;
}
.tl__detail .d-role {
  font-family: var(--serif);
  font-size: var(--step-1);
}
.tl__detail .d-org {
  color: var(--copper);
  font-weight: 600;
}
.tl__detail .d-meta {
  font-size: var(--step--1);
  color: var(--text-soft);
  margin: 0.3rem 0 0.8rem;
  letter-spacing: 0.02em;
}
.tl__detail .d-desc {
  max-width: 70ch;
}
.tl__detail .d-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.tl__hint {
  color: var(--text-soft);
  font-style: italic;
}

/* flavour-note pills (used across timeline + coffee) */
.note-pill {
  font-family: var(--sans);
  font-size: 0.74rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--copper) 12%, transparent);
  color: var(--roast);
  border: 1px solid color-mix(in srgb, var(--copper) 30%, transparent);
  letter-spacing: 0.02em;
}

/* ============================================================
   Origin cards (single-origin identity)
   ============================================================ */
.origins {
  background: var(--espresso);
  color: var(--cream);
}
.origins .section__kicker {
  color: var(--brass);
}
.origins .section__title {
  color: var(--cream);
}
.origins .section__lead {
  color: color-mix(in srgb, var(--cream) 72%, transparent);
}
.origin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 3rem;
}
@media (max-width: 800px) {
  .origin-grid {
    grid-template-columns: 1fr;
  }
}
.origin {
  border: 1px solid color-mix(in srgb, var(--cream) 18%, transparent);
  border-radius: var(--radius);
  padding: 1.8rem;
  background: color-mix(in srgb, var(--cream) 4%, transparent);
  position: relative;
  overflow: hidden;
}
.origin::after {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--copper), var(--brass));
}
.origin__no {
  font-family: var(--serif);
  font-size: var(--step--1);
  color: var(--brass);
  letter-spacing: 0.2em;
}
.origin__name {
  font-family: var(--serif);
  font-size: var(--step-2);
  margin: 0.3rem 0 1.1rem;
  color: var(--cream);
}
.origin__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.55rem;
  border-block-start: 1px solid
    color-mix(in srgb, var(--cream) 12%, transparent);
  font-size: var(--step--1);
}
.origin__row b {
  color: var(--brass);
  font-weight: 500;
}
.origin__row span:last-child {
  color: color-mix(in srgb, var(--cream) 82%, transparent);
  text-align: end;
}
.origin__notes {
  margin-top: 1.1rem;
  font-style: italic;
  color: color-mix(in srgb, var(--cream) 78%, transparent);
  font-family: var(--serif);
}
html[lang="ar"] .origin__notes {
  font-style: normal;
}

/* ============================================================
   Coffee expertise
   ============================================================ */
.coffee__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-top: 2.6rem;
}
.skillcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s;
}
.skillcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -22px rgba(43, 27, 18, 0.5);
}
.skillcard h3 {
  font-size: var(--step-1);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.skillcard h3 .ico {
  color: var(--copper);
  font-family: var(--ar-display);
}
.skillcard .notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* roast scale strip */
.roast-scale {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 2.6rem 0 0;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.roast-scale span {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  font-size: var(--step--1);
  color: var(--cream);
  letter-spacing: 0.05em;
}

/* ============================================================
   Gallery (real artwork + lightbox)
   ============================================================ */
.gal__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
}
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.4rem;
}
@media (max-width: 900px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 560px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
  }
}
.gtile {
  position: relative;
  padding: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--oat), var(--latte));
  cursor: pointer;
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.gtile.hide {
  display: none;
}
.gtile.feat {
  outline: 2px solid var(--brass);
  outline-offset: -2px;
}
.gtile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s var(--ease);
}
.gtile:hover,
.gtile:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -14px rgba(43, 27, 18, 0.5);
  outline: none;
}
.gtile:hover img,
.gtile:focus-visible img {
  transform: scale(1.06);
}
.gtile__cap {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 1.4rem 0.8rem 0.7rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--cream);
  text-align: start;
  background: linear-gradient(
    to top,
    rgba(20, 12, 7, 0.82),
    transparent
  );
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
  pointer-events: none;
}
.gtile:hover .gtile__cap,
.gtile:focus-visible .gtile__cap {
  opacity: 1;
  transform: none;
}
.gal__hint {
  margin-top: 1.4rem;
  font-size: var(--step--1);
  color: var(--text-soft);
  text-align: center;
}

/* --- lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(0.8rem, 3vw, 2rem);
  background: rgba(20, 12, 7, 0.92);
  backdrop-filter: blur(4px);
}
.lightbox.open {
  display: flex;
}
.lb__stage {
  max-width: min(1000px, 100%);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-height: 100%;
}
.lb__img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 10px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  background: var(--cream-2);
}
.lb__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: color-mix(in srgb, var(--cream) 85%, transparent);
  font-size: var(--step--1);
  text-align: center;
}
.lb__count {
  color: var(--brass);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.lb__btn {
  position: absolute;
  z-index: 2;
  background: rgba(244, 236, 224, 0.1);
  border: 1px solid rgba(244, 236, 224, 0.25);
  color: var(--cream);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease);
  line-height: 1;
}
.lb__btn:hover {
  background: rgba(244, 236, 224, 0.22);
  border-color: var(--brass);
}
.lb__close {
  inset-block-start: clamp(0.8rem, 3vw, 1.6rem);
  inset-inline-end: clamp(0.8rem, 3vw, 1.6rem);
  width: 46px;
  height: 46px;
  font-size: 1.9rem;
}
.lb__nav {
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2.2rem;
}
.lb__prev {
  inset-inline-start: clamp(0.5rem, 2vw, 1.6rem);
}
.lb__next {
  inset-inline-end: clamp(0.5rem, 2vw, 1.6rem);
}
/* arrows point the right way in RTL */
html[dir="rtl"] .lb__prev {
  transform: translateY(-50%) scaleX(-1);
}
html[dir="rtl"] .lb__next {
  transform: translateY(-50%) scaleX(-1);
}
@media (max-width: 560px) {
  .lb__nav {
    width: 42px;
    height: 42px;
    font-size: 1.8rem;
  }
  .lb__img {
    max-height: 68vh;
  }
}

/* ============================================================
   Credentials
   ============================================================ */
.creds {
  background: var(--oat);
}
.creds__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2.6rem;
}
.cred {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: transform 0.25s var(--ease);
}
.cred:hover {
  transform: translateY(-3px);
}
.cred.star {
  border-color: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass);
}
.cred__seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--espresso);
  color: var(--brass);
  font-family: var(--ar-display);
  font-size: 1.3rem;
}
.cred.star .cred__seal {
  background: linear-gradient(135deg, var(--copper), var(--brass));
  color: #fff;
}
.cred__name {
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.25;
}
.cred__issuer {
  font-size: var(--step--1);
  color: var(--text-soft);
  margin-top: 0.25rem;
}
.cred__date {
  font-size: 0.72rem;
  color: var(--copper);
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

.edu {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: var(--step-0);
  color: var(--text-soft);
}
.edu b {
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--step-1);
}

/* ============================================================
   Contact / footer
   ============================================================ */
.contact {
  background: var(--espresso);
  color: var(--cream);
  text-align: center;
}
.contact .section__title {
  color: var(--cream);
  margin-inline: auto;
}
.contact__lead {
  color: color-mix(in srgb, var(--cream) 78%, transparent);
  max-width: 46ch;
  margin: 0 auto 2.4rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-1);
}
html[lang="ar"] .contact__lead {
  font-style: normal;
}
.contact__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.contact .btn--primary {
  background: var(--copper);
}
.contact .btn--primary:hover {
  background: var(--copper-lt);
}
.contact .btn--ghost {
  border-color: color-mix(in srgb, var(--cream) 40%, transparent);
  color: var(--cream);
}
.contact .btn--ghost:hover {
  border-color: var(--brass);
  color: var(--brass);
}
.contact__note {
  margin-top: 1.6rem;
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--cream) 55%, transparent);
}

/* --- contact grid: form + direct channels --- */
.contact__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.4rem, 4vw, 3rem);
  text-align: start;
  max-width: 62rem;
  margin: 0.5rem auto 0;
  align-items: start;
}
@media (max-width: 780px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}
.cform__title {
  font-family: var(--serif);
  font-size: var(--step-1);
  color: var(--cream);
  margin-bottom: 1.1rem;
}
.cform {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.cform__hp {
  position: absolute !important;
  left: -9999px;
  opacity: 0;
  width: 0;
  height: 0;
}
.cform__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--cream) 72%, transparent);
}
.cform__field input,
.cform__field textarea {
  font-family: var(--sans);
  font-size: var(--step-0);
  color: var(--cream);
  background: color-mix(in srgb, var(--cream) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--cream) 22%, transparent);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}
html[lang="ar"] .cform__field input,
html[lang="ar"] .cform__field textarea {
  font-family: var(--ar-body, var(--sans));
}
.cform__field textarea {
  resize: vertical;
  min-height: 96px;
}
.cform__field input:focus,
.cform__field textarea:focus {
  outline: none;
  border-color: var(--brass);
  background: color-mix(in srgb, var(--cream) 12%, transparent);
}
.cform__field input::placeholder,
.cform__field textarea::placeholder {
  color: color-mix(in srgb, var(--cream) 40%, transparent);
}
.cform__submit {
  align-self: start;
  margin-top: 0.2rem;
}
.form__status {
  font-size: var(--step--1);
  min-height: 1.2em;
  color: color-mix(in srgb, var(--cream) 70%, transparent);
}
.form__status a {
  color: var(--brass);
}
.form__status.ok {
  color: #9fd6a0;
}
.form__status.err {
  color: #e6b7a0;
}

/* --- direct channels --- */
.cmethods {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.cmethod {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--cream) 16%, transparent);
  background: color-mix(in srgb, var(--cream) 5%, transparent);
  color: var(--cream);
  text-decoration: none;
  transition:
    border-color 0.25s var(--ease),
    background 0.25s var(--ease),
    transform 0.25s var(--ease);
}
a.cmethod:hover {
  border-color: var(--brass);
  background: color-mix(in srgb, var(--cream) 9%, transparent);
  transform: translateY(-2px);
}
.cmethod__ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--copper) 30%, transparent);
  color: var(--cream);
  font-size: 1.15rem;
  font-weight: 600;
}
.cmethod__ico--wa {
  background: #1faf54;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.cmethod__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.cmethod__k {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 58%, transparent);
}
.cmethod__v {
  font-size: var(--step-0);
  color: var(--cream);
  text-decoration: none;
  word-break: break-word;
}
a.cmethod__v:hover {
  color: var(--brass);
}
.cmethod__note {
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--cream) 50%, transparent);
  margin-top: 0.1rem;
}
.cmethod--ig {
  align-items: center;
}
.cig__qr {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: block;
  padding: 4px;
  transition: transform 0.25s var(--ease);
}
.cig__qr:hover {
  transform: scale(1.04);
}
.cig__qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-footer {
  background: var(--roast);
  color: color-mix(in srgb, var(--cream) 65%, transparent);
  padding: 2rem;
  text-align: center;
  font-size: var(--step--1);
}
.site-footer .glyph {
  font-family: var(--ar-display);
  color: var(--brass);
}

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] {
  transition-delay: 0.08s;
}
.reveal[data-delay="2"] {
  transition-delay: 0.16s;
}
.reveal[data-delay="3"] {
  transition-delay: 0.24s;
}
.reveal[data-delay="4"] {
  transition-delay: 0.32s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .bar,
  .skillcard,
  .cred {
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .bar {
    opacity: 1;
    transform: none;
  }
  .pulse {
    animation: none;
  }
}
