/* Yara's House: digital business card.
   Colours come from the logo PDF: bronze #B07A45 on white. --bronze-ink and --bronze-tint are the same hue,
   darker (small text must reach 4.5:1 contrast) and lighter (soft surfaces). */
:root {
  --bronze: #b07a45;
  --bronze-ink: #7a4f27;
  --bronze-tint: #f7efe7;
  --line: #e9dccd;
  --paper: #ffffff;
  --serif: 'Liberation Serif', 'Times New Roman', Tinos, Times, 'Noto Serif', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: var(--paper);
  color: var(--bronze-ink);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------------ language tile (same pattern as jabjob.ma) */
.lang {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  z-index: 20;
}
.lang-tile {
  list-style: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 0.8px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 2px 10px rgba(122, 79, 39, 0.1);
  color: var(--bronze-ink);
  font: 700 16px/1 var(--sans);
  letter-spacing: 0;
  user-select: none;
}
.lang-tile::-webkit-details-marker {
  display: none;
}
.lang-tile:focus-visible,
.lang-option:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}
.lang[open] .lang-tile {
  border-color: var(--bronze);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 156px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 0.8px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgba(122, 79, 39, 0.16);
  animation: menu-in 0.18s var(--ease);
}
.lang-option {
  display: block;
  padding: 10px 12px;
  border-inline-start: 3px solid transparent;
  border-radius: 8px;
  color: var(--bronze-ink);
  font: 500 15px/1.25 var(--sans);
  letter-spacing: 0;
  text-decoration: none;
}
a.lang-option:hover {
  background: var(--bronze-tint);
}
.lang-option[aria-current] {
  border-inline-start-color: var(--bronze);
  background: var(--bronze-tint);
  font-weight: 700;
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ------------------------------------------------------------------ layout */
.card {
  width: min(100%, 440px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom));
  text-align: center;
}

/* ------------------------------------------------------------------ stage: the interactive logo */
.stage {
  position: relative;
  width: 100%;
  height: clamp(250px, 37vh, 410px);
  height: clamp(250px, 37dvh, 410px);
  margin: 26px 0 16px;
  flex: none;
}
.stage::before {
  content: '';
  position: absolute;
  inset: 6% 2%;
  background: radial-gradient(closest-side, rgba(176, 122, 69, 0.17), rgba(176, 122, 69, 0));
  pointer-events: none;
}
.logo-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  touch-action: pan-y;
  cursor: grab;
  transition: opacity 0.7s ease;
}
.logo-canvas.on {
  opacity: 1;
}
.logo-canvas.grabbing {
  cursor: grabbing;
}
.hint {
  position: absolute;
  inset-inline: 0;
  bottom: 2px;
  margin: 0;
  font: 500 11.5px/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze-ink);
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
:lang(ar) .hint {
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
}
.stage.touched .hint,
html.use-fallback .hint {
  opacity: 0 !important;
  animation: none;
}

/* flat logo: no-JS, no-WebGL and reduced-motion fallback, drawn with CSS */
.fallback-logo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.logo-svg {
  width: min(78%, 330px);
  height: auto;
  overflow: visible;
}
.lp {
  stroke-dasharray: 1;
}
html:not(.js) .fallback-logo,
html.use-fallback .fallback-logo {
  opacity: 1;
}
html.use-fallback .stage.is-3d .fallback-logo {
  opacity: 0;
}
html:not(.js) .lp,
html.use-fallback .lp {
  animation: draw 1.6s cubic-bezier(0.45, 0, 0.2, 1) both;
  animation-delay: calc(var(--i) * 70ms);
}
@keyframes draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ------------------------------------------------------------------ wordmark (proportions taken from the logo PDF) */
.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--bronze);
  line-height: 1;
}
.wm-name,
.wm-sub {
  display: block;
  text-transform: uppercase;
}
.wm-name {
  padding-inline-start: 0.06em;
  font-size: clamp(46px, 14.5vw, 60px);
  letter-spacing: 0.06em;
}
.wm-sub {
  margin-top: 0.38em;
  padding-inline-start: 0.23em;
  font-size: clamp(18px, 5.7vw, 23.5px);
  letter-spacing: 0.23em;
}
.rule {
  width: 56px;
  height: 1px;
  margin: 20px 0 16px;
  background: var(--bronze);
}
.slogan {
  margin: 0;
  font: italic 400 17px/1.3 var(--serif);
  letter-spacing: 0.07em;
  color: var(--bronze);
}
.descriptor {
  margin: 12px 0 0;
  font: 600 12px/1.2 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze-ink);
}
:lang(ar) .slogan {
  font: normal 400 18px/1.5 var(--sans);
  letter-spacing: 0;
}
:lang(ar) .descriptor {
  font-size: 14.5px;
  letter-spacing: 0;
  text-transform: none;
}

/* ------------------------------------------------------------------ actions */
.actions {
  width: 100%;
  margin-top: 26px;
  display: grid;
  gap: 12px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 54px;
  padding: 0 16px;
  border: 1.5px solid var(--bronze);
  border-radius: 14px;
  background: transparent;
  color: var(--bronze-ink);
  font: 700 19px/1 var(--sans);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn svg {
  width: 23px;
  height: 23px;
  flex: none;
}
.btn:hover {
  background: var(--bronze-tint);
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(0.98);
}
.btn--primary {
  background: var(--bronze);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(176, 122, 69, 0.9);
}
.btn--primary:hover {
  background: #a06f3c;
}
.btn--ghost {
  border-style: dashed;
}
.foot {
  margin-top: auto;
  padding-top: 26px;
  font: 500 12.5px/1.3 var(--sans);
  letter-spacing: 0.04em;
  color: var(--bronze-ink);
  opacity: 0.85;
}

/* ------------------------------------------------------------------ entrance (starts when the logo has begun to draw) */
html.js .reveal {
  opacity: 0;
}
html.js.is-ready .reveal {
  animation: rise 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
html.js.is-ready .wm-name.reveal {
  animation-name: track;
  animation-duration: 1.5s;
}
html.js.is-ready .foot.reveal {
  animation-name: fade;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes track {
  from {
    opacity: 0;
    letter-spacing: 0.3em;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.06em;
    filter: blur(0);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js .reveal {
    opacity: 1;
  }
  html.js .foot.reveal {
    opacity: 0.85;
  }
  html.js.is-ready .reveal,
  html.use-fallback .lp,
  .lang-menu {
    animation: none !important;
  }
  .btn,
  .logo-canvas {
    transition: none;
  }
}

@media (min-width: 700px) {
  .stage {
    margin-top: 36px;
  }
}
