/* ==========================================================================
   yemeni-coffee.ch — Dr. Import
   Palette and forms taken from the qamariya: the gypsum tracery and coloured
   glass fanlight of a Sana'a tower house. Each origin carries its own glass
   colour, so colour encodes provenance rather than decorating.
   ========================================================================== */

:root {
  --ink:      #14202E;
  --ink-2:    #1D2E42;
  --ink-3:    #2B3D53;
  --gypsum:   #EFEEE7;
  --paper:    #F8F7F2;
  --earth:    #7A4A2B;
  --earth-lt: #A9764C;

  --amber:    #C8842B;
  --ruby:     #9E2B33;
  --emerald:  #2E6152;
  --sapphire: #2A64A8;

  --text:     #1B242E;
  --muted:    #58636F;
  --rule:     #D8D6CC;

  --measure: 68ch;
  --page: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --block: clamp(3rem, 7vw, 5.5rem);

  --serif: "Amiri", "Iowan Old Style", Georgia, serif;
  --sans:  "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  font-weight: 400;
}

img, svg { max-width: 100%; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: -999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--gypsum); padding: .75rem 1.25rem;
}
.skip:focus { left: 0; }

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

/* --- typography ---------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.005em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3.1vw, 3.75rem); }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2.3rem); margin-top: 2.2em; }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); margin-top: 1.7em; }
h2:first-child, h3:first-child { margin-top: 0; }

p { margin: 0 0 1.15em; max-width: var(--measure); }
a { color: var(--earth); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ruby); }

.lead {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1rem + 0.85vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34ch;
}

/* --- layout -------------------------------------------------------------- */
.bar, .page, .prose, .cta-inner, .foot-top, .foot-bottom, .contactgrid {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gap);
}

main { display: block; }

/* --- header -------------------------------------------------------------- */
header.site {
  background: var(--ink);
  color: var(--gypsum);
  position: sticky; top: 0; z-index: 40;
}
header.site .bar {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 68px;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  color: var(--gypsum); text-decoration: none; flex: 0 0 auto;
}
.brand-mark { color: var(--amber); display: flex; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-family: var(--serif); font-size: 1.22rem; font-weight: 700; }
.brand-txt i {
  font-style: normal; font-size: .68rem; color: #93A2B2;
  letter-spacing: .04em;
}
.brand:hover .brand-txt b { color: var(--amber); }

.mainnav { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
.navlist, .langlist { list-style: none; display: flex; margin: 0; padding: 0; }
.navlist { gap: 1.15rem; flex-wrap: wrap; }
.navlist a {
  color: #D3DAE2; text-decoration: none; font-size: .88rem; font-weight: 500;
  padding: .35rem 0; border-bottom: 2px solid transparent; display: block;
}
.navlist a:hover { color: #fff; border-bottom-color: var(--amber); }
.navlist a.on { color: var(--amber); border-bottom-color: var(--amber); }

.langlist { gap: .45rem; padding-left: 1.15rem; border-left: 1px solid #33465C; }
.langlist a {
  color: #8E9DAD; text-decoration: none; font-size: .74rem; font-weight: 500;
  text-transform: none;
}
.langlist a:hover { color: #fff; }
.langlist a[aria-current] { color: var(--gypsum); text-decoration: underline; }

.burger { display: none; }

/* --- buttons ------------------------------------------------------------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600;
  font-size: .95rem; padding: .82rem 1.5rem; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; line-height: 1.2;
  border-radius: 2px;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.btn-solid { background: var(--amber); color: #16202B; border-color: var(--amber); }
.btn-solid:hover { background: #E09B3B; border-color: #E09B3B; color: #16202B; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--gypsum); }
.btn-sm { padding: .55rem 1rem; font-size: .85rem; }

.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 0; }

/* --- hero ---------------------------------------------------------------- */
.hero {
  background: var(--ink);
  color: var(--gypsum);
  position: relative; overflow: hidden;
  padding: clamp(2.5rem, 6vw, 5rem) var(--gap) clamp(4rem, 9vw, 7rem);
  display: grid; gap: clamp(1.5rem, 4vw, 4rem);
  grid-template-columns: auto 1fr;
  align-items: center;
  max-width: var(--page); margin-inline: auto;
}
.hero-art { position: relative; z-index: 2; }
.hero-txt { position: relative; z-index: 2; }
.hero h1 { color: var(--gypsum); max-width: 15ch; }
.hero .lead { color: #C4CEDA; max-width: 40ch; }
.hero .btn-line { color: var(--gypsum); border-color: #56687D; }
.hero .btn-line:hover { background: var(--gypsum); color: var(--ink); border-color: var(--gypsum); }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 2rem;
  margin-top: clamp(2rem, 5vw, 3.25rem);
  padding-top: 1.5rem; border-top: 1px solid #2E4258;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--serif); font-size: 1.6rem; color: var(--amber); }
.hero-stats span { font-size: .82rem; color: #93A2B2; max-width: 22ch; }

.terraces {
  position: absolute; inset: auto 0 0 0; height: 190px; width: 100%;
  color: var(--amber); opacity: .45; z-index: 1; pointer-events: none;
}

/* qamariya glass panes: one orchestrated reveal on load, nothing else moves */
.qamariya .pane { opacity: 0; animation: lightUp .34s ease-out forwards; animation-delay: var(--d, 0ms); }
@keyframes lightUp { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .qamariya .pane { animation: none; opacity: 1; }
}

/* --- interior page masthead --------------------------------------------- */
.page { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: var(--block); }

.masthead {
  border-left: 5px solid var(--amber);
  padding-left: clamp(1rem, 2.5vw, 1.75rem);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.masthead.tone-ruby     { border-left-color: var(--ruby); }
.masthead.tone-emerald  { border-left-color: var(--emerald); }
.masthead.tone-sapphire { border-left-color: var(--sapphire); }

.crumbs { margin-bottom: 1.4rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; font-size: .8rem; }
.crumbs li + li::before { content: "/"; color: var(--rule); margin-right: .45rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--earth); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

/* --- facts list (variety pages) ------------------------------------------ */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; margin: 2.25rem 0 0; padding: 0;
  background: var(--rule); border: 1px solid var(--rule);
}
.facts div { background: var(--paper); padding: .85rem 1rem; }
.facts dt { font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.facts dd { margin: 0; font-family: var(--serif); font-size: 1.12rem; color: var(--ink); }
.facts[class*="tone-"] div:first-child dd { color: var(--earth); }

/* --- prose --------------------------------------------------------------- */
.prose { padding-bottom: var(--block); }
.prose > h2 { max-width: 22ch; }
.prose > h2::after {
  content: ""; display: block; width: 46px; height: 3px;
  background: var(--amber); margin-top: .55rem;
}

ul.marks { list-style: none; padding: 0; margin: 0 0 1.4em; max-width: var(--measure); }
ul.marks li { position: relative; padding-left: 1.5rem; margin-bottom: .55em; }
ul.marks li::before {
  content: ""; position: absolute; left: 0; top: .58em;
  width: 8px; height: 11px; background: var(--earth-lt);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

ol.steps { padding-left: 0; list-style: none; counter-reset: st; max-width: var(--measure); margin: 0 0 1.4em; }
ol.steps li {
  counter-increment: st; position: relative; padding-left: 2.6rem; margin-bottom: 1em;
}
ol.steps li::before {
  content: counter(st); position: absolute; left: 0; top: .05em;
  width: 1.85rem; height: 1.85rem; display: grid; place-items: center;
  background: var(--ink); color: var(--gypsum); border-radius: 50%;
  font-family: var(--serif); font-size: .95rem;
}

.tablewrap { overflow-x: auto; margin: 0 0 1.8em; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--gypsum); font-weight: 600; font-size: .8rem; color: var(--ink); }
tbody tr:hover { background: #F2F0E9; }

.note {
  border-left: 3px solid var(--emerald);
  background: #F1F3F0;
  padding: 1rem 1.25rem; margin: 0 0 1.8em; max-width: var(--measure);
}
.note p { margin: 0; font-size: .95rem; }

/* --- cards with an arched head (the qamariya silhouette) ----------------- */
.cardgrid {
  display: grid; gap: 1.25rem; margin: 2rem 0 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}
.card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--rule);
  padding: 0 1.35rem 1.4rem;
  transition: border-color .18s ease, transform .18s ease;
}
.card-arch {
  display: block; height: 46px; margin: 0 auto 1.1rem; width: 62px;
  background: var(--amber);
  border-radius: 50% 50% 0 0 / 62% 62% 0 0;
}
.card.tone-ruby     .card-arch { background: var(--ruby); }
.card.tone-emerald  .card-arch { background: var(--emerald); }
.card.tone-sapphire .card-arch { background: var(--sapphire); }
.card h3 { margin: 0 0 .45rem; font-size: 1.24rem; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); max-width: none; }
.card:hover { border-color: var(--ink); }

/* --- FAQ ----------------------------------------------------------------- */
.faqlist { max-width: var(--measure); margin-bottom: 2rem; }
.qa { border-bottom: 1px solid var(--rule); }
.qa summary {
  cursor: pointer; padding: 1rem 2rem 1rem 0; position: relative; list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { display: inline; margin: 0; font-size: 1.08rem; }
.qa summary::after {
  content: "+"; position: absolute; right: .25rem; top: .9rem;
  font-family: var(--serif); font-size: 1.5rem; color: var(--earth); line-height: 1;
}
.qa[open] summary::after { content: "\2013"; }
.qa-body { padding: 0 0 1.1rem; }
.qa-body p { margin: 0; color: var(--muted); }

/* --- related ------------------------------------------------------------- */
.related { border-top: 1px solid var(--rule); padding-top: 2rem; }
.related h2 { font-size: 1.25rem; margin: 0 0 1.1rem; }
.related h2::after { content: none; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.related a { display: block; text-decoration: none; padding: .85rem 1rem; background: var(--gypsum); }
.related a span { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--ink); }
.related a small { display: block; font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.related a:hover { background: var(--ink); }
.related a:hover span, .related a:hover small { color: var(--gypsum); }

/* --- CTA ----------------------------------------------------------------- */
section.cta { background: var(--ink); color: var(--gypsum); }
.cta-inner { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.cta-inner h2 { color: var(--gypsum); margin-top: 0; max-width: 20ch; }
.cta-inner h2::after { content: none; }
.cta-inner > p { color: #B7C2CE; max-width: 54ch; }
section.cta .btn-line { color: var(--gypsum); border-color: #56687D; }
section.cta .btn-line:hover { background: var(--gypsum); color: var(--ink); border-color: var(--gypsum); }
.cta-meta { font-size: .82rem; color: #7E8D9C; margin: 1.4rem 0 0; }

/* --- contact ------------------------------------------------------------- */
.contactgrid { padding-bottom: var(--block); }
.contactcards {
  display: grid; gap: 1rem; margin-bottom: 2.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.ccard {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--rule); background: #fff; padding: 1.25rem;
  border-top: 4px solid var(--amber);
}
.ccard:nth-child(2) { border-top-color: var(--emerald); }
.ccard:nth-child(3) { border-top-color: var(--sapphire); }
.ccard h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.ccard p { margin: 0 0 .25rem; font-weight: 600; color: var(--earth); max-width: none; }
.ccard small { color: var(--muted); font-size: .82rem; }
.ccard:hover { border-color: var(--ink); }

form.inquiry {
  display: grid; gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  background: var(--gypsum); padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--rule);
}
form.inquiry h3 { grid-column: 1 / -1; margin: 0; }
.field { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .84rem; font-weight: 500; color: var(--ink); }
.field input, .field textarea {
  font: inherit; font-size: .95rem; padding: .65rem .75rem;
  border: 1px solid #C6C4B9; background: #fff; color: var(--text); border-radius: 2px;
}
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.consent label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; color: var(--muted); font-size: .85rem; }
.consent input { width: auto; flex: 0 0 auto; margin-top: .2rem; }
.hp { position: absolute; left: -9999px; }
.formnote { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); margin: 0; }
.formmsg { grid-column: 1 / -1; padding: .8rem 1rem; font-size: .9rem; margin: 0; }
.formmsg.ok { background: #E2EDE7; border-left: 3px solid var(--emerald); }
.formmsg.error { background: #F5E4E5; border-left: 3px solid var(--ruby); }

/* --- footer -------------------------------------------------------------- */
footer.site { background: var(--ink); color: #A9B6C4; padding-top: clamp(2.5rem, 5vw, 4rem); }
.foot-top { display: grid; gap: 2.5rem; grid-template-columns: minmax(220px, 1fr) 2.4fr; }
.foot-brand { font-family: var(--serif); font-size: 1.4rem; color: var(--gypsum); margin: 0 0 .4rem; }
.foot-claim { font-size: .88rem; margin: 0 0 1rem; max-width: 30ch; }
.foot-contact { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.foot-contact a { color: var(--amber); text-decoration: none; }
.foot-contact a:hover { text-decoration: underline; }

.foot-nav { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.foot-nav h2 {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  color: var(--gypsum); margin: 0 0 .7rem; letter-spacing: .01em;
}
.foot-nav h2::after { content: none; }
.foot-nav ul { list-style: none; padding: 0; margin: 0; }
.foot-nav li { margin-bottom: .4rem; }
.foot-nav a { color: #A9B6C4; text-decoration: none; font-size: .86rem; }
.foot-nav a:hover { color: var(--amber); }

.foot-bottom {
  margin-top: clamp(2rem, 5vw, 3.25rem); padding-block: 1.25rem;
  border-top: 1px solid #2A3B4E;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: .8rem;
}
.foot-bottom p { margin: 0; max-width: none; }
.foot-langs a { color: #8A98A7; text-decoration: none; margin-left: .7rem; }
.foot-langs a:first-child { margin-left: 0; }
.foot-langs a:hover { color: var(--amber); }

/* --- root language landing ---------------------------------------------- */
body.rootpage { background: var(--ink); color: var(--gypsum); display: grid; place-items: center; min-height: 100vh; }
.rootmain { text-align: center; padding: 3rem var(--gap); max-width: 1060px; width: 100%; }
.root-art { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.rootmain h1 { font-size: clamp(2.4rem, 7vw, 4rem); margin-bottom: .15em; }
.root-sub { color: #93A2B2; margin: 0 auto 2.5rem; font-size: .95rem; }
.lcards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.lcard {
  text-decoration: none; color: var(--gypsum); border: 1px solid #33465C;
  padding: 1.2rem 1rem; display: block;
  transition: border-color .18s ease, background-color .18s ease;
}
.lcard h2 { font-size: 1.3rem; margin: 0 0 .35rem; }
.lcard p { font-size: .82rem; color: #93A2B2; margin: 0 0 .5rem; max-width: none; }
.lcard small { color: var(--amber); font-size: .78rem; }
.lcard:hover { border-color: var(--amber); background: #1B2B3D; }
.root-contact { margin-top: 2.5rem; font-size: .9rem; }
.root-contact a { color: var(--amber); text-decoration: none; }
.notfound-langs { list-style: none; padding: 0; display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.notfound-langs a { color: var(--amber); text-decoration: none; }

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 1080px) {
  .navlist { gap: .9rem; }
  .navlist a { font-size: .82rem; }
  .navcta { display: none; }
}

@media (max-width: 900px) {
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; width: 44px; height: 44px; padding: 0 10px;
    background: none; border: 1px solid #33465C; cursor: pointer; border-radius: 2px;
  }
  .burger span { display: block; height: 2px; background: var(--gypsum); }
  .burger[aria-expanded="true"] { border-color: var(--amber); }
  .mainnav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ink-2); flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem var(--gap) 1.5rem; border-top: 1px solid #33465C;
  }
  .mainnav.open { display: flex; }
  .navlist { flex-direction: column; gap: 0; }
  .navlist a { padding: .8rem 0; border-bottom: 1px solid #2A3B4E; }
  .navlist a:hover, .navlist a.on { border-bottom-color: #2A3B4E; }
  .langlist { border-left: 0; padding: 1rem 0 0; gap: 1rem; }
  .langlist a { font-size: .88rem; }
  header.site .bar { position: relative; flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 210px; }
  .foot-top { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero-stats { gap: 1.25rem; }
  .hero-stats b { font-size: 1.35rem; }
  .cta-actions .btn { flex: 1 1 100%; text-align: center; }
}

@media print {
  header.site, footer.site, section.cta, .related, .crumbs, .terraces { display: none; }
  body { background: #fff; font-size: 11pt; }
}
