/* CLINK | Al Narjis – independent concept preview.
   Colors are design choices drawn loosely from the photographed stone, dark glass frame and planting.
   They are NOT certified brand colors. Body type is a neutral system stack (no brand typeface is claimed). */

:root {
  --stone: #eeebe5;
  --stone-2: #e3dfd7;
  --stone-3: #cbc6bb;
  --charcoal: #202527;
  --charcoal-2: #474d50;
  --green: #2f4d37;
  --on-green: #ffffff;
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: 520ms;

  /* aperture geometry, taken from the photo (1204x1600): circle centred between the sign and the round window */
  --cx: 55.2%;
  --cy: 65.6cqw;          /* circle centre y, measured on the photo (790/1204 of its width) */
  --r-circle: 35.7cqw;
  --r-peek: 39cqw;
  --r-wide: 58cqw;
  --r-full: 96cqw;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--charcoal);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 10;
  background: var(--charcoal); color: var(--stone); padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

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

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin-inline: auto; padding: 14px 20px;
}
.top__name { font-weight: 650; letter-spacing: .22em; font-size: .95rem; }
.top__link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding-inline: 8px;
  text-decoration: none; font-size: .95rem; border-bottom: 1px solid transparent;
}
.top__link:hover { border-bottom-color: currentColor; }

/* ---------- hero ---------- */
.hero {
  max-width: 1200px; margin-inline: auto; padding: 8px 20px 40px;
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "controls" "figure";
}
.hero__intro { grid-area: intro; }
.hero__figure { grid-area: figure; margin: 0; }
.hero__controls { grid-area: controls; }

.eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--charcoal-2);
}
.eyebrow__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
h1 {
  margin: 0; font-weight: 500; letter-spacing: -.015em; line-height: 1.1;
  font-size: clamp(1.9rem, 7.4vw, 3.5rem); text-wrap: balance; max-width: 14ch;
}

/* ---------- aperture stage ---------- */
/* The stage's height follows the view (circle -> wider -> original) so the circle never floats in dead space.
   The photo keeps its true 1204x1600 proportions at all times; only its offset and the clip change. */
.stage {
  --r: var(--r-circle);
  --off: -23.6cqw;
  position: relative;
  container-type: inline-size;
  overflow: clip;
  width: min(100%, 440px);
  aspect-ratio: 100 / 84;
  margin-inline: auto;
  transition: aspect-ratio var(--dur) var(--ease);
}
.stage[data-view="wide"] { --r: var(--r-wide); --off: -5.6cqw; aspect-ratio: 100 / 120; }
.stage[data-view="full"] { --r: var(--r-full); --off: 0cqw; aspect-ratio: 1204 / 1600; }
.js .stage[data-view="circle"]:has(.stage__hit:hover),
.js .stage[data-view="circle"]:has(.stage__hit:focus-visible) { --r: var(--r-peek); }
.no-js .stage { --r: var(--r-full); --off: 0cqw; aspect-ratio: 1204 / 1600; }
@media (hover: none) {
  .js .stage[data-view="circle"]:has(.stage__hit:hover) { --r: var(--r-circle); }
}

.stage__img {
  position: absolute; left: 0; top: var(--off); width: 100%; height: auto;
  aspect-ratio: 1204 / 1600; object-fit: cover; border-radius: var(--radius);
  clip-path: circle(var(--r) at var(--cx) var(--cy));
  transition: clip-path var(--dur) var(--ease), top var(--dur) var(--ease);
}
.stage__ring {
  position: absolute; pointer-events: none;
  --rr: calc(var(--r) + 1.8cqw);
  width: calc(var(--rr) * 2); height: calc(var(--rr) * 2);
  left: calc(var(--cx) - var(--rr)); top: calc(var(--off) + var(--cy) - var(--rr));
  border: 1px solid rgba(32, 37, 39, .28); border-radius: 50%;
  transition: width var(--dur) var(--ease), height var(--dur) var(--ease),
              left var(--dur) var(--ease), top var(--dur) var(--ease), opacity 240ms var(--ease);
}
.stage[data-view="wide"] .stage__ring { opacity: 0; }
.stage[data-view="full"] .stage__ring, .no-js .stage__ring { opacity: 0; }

.stage__hit {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; padding: 0; margin: 0; background: transparent; border-radius: var(--radius);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.stage__hit:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.no-js .stage__hit, .no-js .hero__controls { display: none; }

figcaption {
  width: min(100%, 440px); margin: 10px auto 0;
  font-size: .78rem; color: var(--charcoal-2); line-height: 1.4;
}
.img-error { color: #8a2d1f; font-size: .9rem; text-align: center; }

/* ---------- view controls ---------- */
.hint { margin: 0 0 8px; font-size: .9rem; color: var(--charcoal-2); }
.seg {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--stone-3); border-radius: 12px; overflow: hidden; background: var(--stone-2);
  width: min(100%, 440px); margin-inline: auto;
}
.seg__btn {
  min-height: 48px; padding: 8px 6px; border: 0; background: transparent; color: var(--charcoal);
  font: inherit; font-size: .9rem; line-height: 1.2; cursor: pointer;
  border-inline-start: 1px solid var(--stone-3);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.seg__btn:first-child { border-inline-start: 0; }
.seg__btn:hover { background: var(--stone-3); }
.seg__btn[aria-pressed="true"] { background: var(--green); color: var(--on-green); font-weight: 600; }
.seg__btn:focus-visible { outline-offset: -4px; outline-color: var(--charcoal); }
.seg__btn[aria-pressed="true"]:focus-visible { outline-color: #fff; }
.hint { width: min(100%, 440px); margin-inline: auto; margin-bottom: 8px; }

/* ---------- visit ---------- */
.visit {
  background: var(--stone-2); padding: 56px 20px 64px;
}
.visit > * { max-width: 1160px; }
.visit {
  display: grid; gap: 28px; justify-items: center;
  grid-template-columns: minmax(0, 1fr);
}
.visit__copy { width: min(100%, 440px); }
.visit h2 { margin: 0 0 6px; font-size: 1.9rem; font-weight: 500; letter-spacing: -.01em; }
.visit p { margin: 0 0 6px; }
.visit__note { font-size: .88rem; color: var(--charcoal-2); }

.arch-wrap { container-type: inline-size; width: min(100%, 440px); }
.arch {
  background: var(--charcoal); color: var(--stone);
  border-radius: 50cqw 50cqw 18px 18px;
  padding: calc(50cqw * .55) 24px 28px;
  display: grid; gap: 12px;
}
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 12px 18px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 1rem; border: 1.5px solid var(--stone);
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--stone); color: var(--charcoal); }
.btn--primary:hover { background: #fff; }
.btn--ghost { background: transparent; color: var(--stone); }
.btn--ghost:hover { background: rgba(238, 235, 229, .14); }
.arch .btn:focus-visible { outline-color: #fff; outline-offset: 3px; }

/* ---------- footer ---------- */
.foot { max-width: 1200px; margin-inline: auto; padding: 22px 20px 36px; }
.foot p { margin: 0; max-width: 62ch; font-size: .8rem; color: var(--charcoal-2); line-height: 1.5; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .top { padding: 18px 32px; }
  .hero {
    --w: max(300px, min(560px, calc((100svh - 190px) * .7525)));
    min-height: calc(100svh - 80px);
    padding: 8px 32px 48px; column-gap: 64px; row-gap: 24px; align-content: center;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "intro figure" "controls figure";
  }
  .hero__intro { align-self: end; }
  .hero__controls { align-self: start; }
  .hero__figure {
    display: flex; flex-direction: column; justify-content: center;
    min-height: calc(var(--w) * 1.3289 + 44px); /* reserve the tallest view so nothing jumps */
  }
  .stage, figcaption { width: var(--w); max-width: 100%; }
  .hint, .seg { margin-inline: 0; width: min(100%, 440px); }
  h1 { font-size: clamp(2.6rem, 4.4vw, 4rem); max-width: 11ch; }
  .visit { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); justify-items: stretch; padding: 72px 32px 80px; column-gap: 64px; align-items: center; }
  .visit__copy { width: auto; justify-self: start; max-width: 520px; }
  .arch-wrap { justify-self: end; }
  .foot { padding-inline: 32px; }
}

/* ---------- reduced motion / contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage, .stage__img, .stage__ring, .seg__btn, .btn { transition: none !important; }
  .btn:active { transform: none; }
}
@media (forced-colors: active) {
  .seg__btn[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
  .stage__ring { border-color: CanvasText; }
}
