/* =========================================================
   ORA — Office for Rural Architecture
   Landing (ORA) + Secaria Rural Escape (coming soon)
   Minimalist / editorial / fixed cinematic scroll
   ========================================================= */

:root {
  --bone:  #F1ECE2;
  --sand:  #D8C7AC;
  --wood:  #B7936A;
  --moss:  #838868;
  --ink:   #17160F;

  --paper:     rgba(246, 243, 236, 0.97);
  --paper-dim: rgba(246, 243, 236, 0.74);
  --paper-faint: rgba(246, 243, 236, 0.5);

  --tshadow: 0 1px 2px rgba(8, 10, 6, 0.4), 0 1px 14px rgba(8, 10, 6, 0.55), 0 2px 40px rgba(8, 10, 6, 0.55);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1.4rem, 5vw, 4.5rem);

  --fs-display: clamp(3rem, 10vw, 9.5rem);
  --fs-statement: clamp(1.8rem, 4.8vw, 4rem);
  --fs-h2: clamp(2rem, 5.5vw, 4.4rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--paper);
  background: #0e0f0a;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--wood); color: var(--ink); }

/* ---------- Fixed cinematic stage ---------- */
.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }

.frame {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  will-change: opacity, transform;
  transition: opacity 0.15s linear;
}
.frame[data-frame="0"] { opacity: 1; }
/* Landing shows a single still */
.stage.single .frame { opacity: 1; transform: scale(1.04); }

.stage-scrim {
  position: absolute; inset: 0;
  /* Only the lower part is darkened — for the title + location. Top stays clean. */
  background:
    linear-gradient(to top, rgba(12,13,8,0.74) 0%, rgba(12,13,8,0.28) 34%, rgba(12,13,8,0) 64%);
}

/* Landing text is centered over the bright middle — darken the center */
.page-landing .stage-scrim {
  background:
    radial-gradient(ellipse 68% 66% at 50% 50%, rgba(12,13,8,0.6) 0%, rgba(12,13,8,0.15) 45%, rgba(12,13,8,0) 72%),
    linear-gradient(to bottom, rgba(12,13,8,0.42) 0%, rgba(12,13,8,0) 30%, rgba(12,13,8,0) 60%, rgba(12,13,8,0.6) 100%);
}

.stage-grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.045;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ---------- Fixed UI ---------- */
.ui {
  position: fixed;
  left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.1rem, 3vw, 2.1rem) var(--gutter);
  /* Keep clear of notch / rounded corners in landscape */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  pointer-events: none;
}
.ui a, .ui button { pointer-events: auto; }
.ui-top { top: 0; padding-top: max(clamp(1.1rem, 3vw, 2.1rem), env(safe-area-inset-top)); }
.ui-bottom { bottom: 0; padding-bottom: max(clamp(1.1rem, 3vw, 2.1rem), env(safe-area-inset-bottom)); }
.ui-right { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }

.brand-mark {
  width: clamp(40px, 4.6vw, 56px);
  height: auto;
  display: block;
  filter: invert(1) brightness(2.2) drop-shadow(0 1px 10px rgba(0,0,0,0.4));
  opacity: 0.94;
  transition: opacity 0.4s var(--ease);
}
.brand:hover .brand-mark { opacity: 1; }

.status,
.scroll-hint,
.meta-label,
.lang {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-weight: 500;
}

.status { display: flex; align-items: center; gap: 0.6em; color: var(--paper-dim); text-shadow: var(--tshadow); }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--wood);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(183,147,106,0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(183,147,106,0); }
  100% { box-shadow: 0 0 0 0 rgba(183,147,106,0); }
}

/* Language toggle */
.lang { display: inline-flex; align-items: center; gap: 0.5em; color: var(--paper-faint); text-shadow: var(--tshadow); }
.lang button {
  background: none; border: none; cursor: pointer;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: var(--paper-faint);
  padding: 0.2em 0;
  transition: color 0.3s var(--ease);
}
.lang button:hover { color: var(--paper); }
.lang button.active { color: var(--paper); }
.lang .sep { opacity: 0.4; }

.meta-link {
  display: flex; flex-direction: column; gap: 0.35em;
  text-decoration: none; color: var(--paper);
  text-shadow: var(--tshadow);
}
.meta-label { color: var(--paper-dim); }
.meta-value { font-size: 0.82rem; letter-spacing: 0.02em; opacity: 0.92; transition: opacity 0.35s var(--ease); }
.meta-link:hover .meta-value { opacity: 1; }

.scroll-hint {
  display: flex; align-items: center; gap: 0.8em;
  color: var(--paper-dim); text-shadow: var(--tshadow);
  transition: opacity 0.6s var(--ease);
}
.scroll-line {
  width: 46px; height: 1px;
  background: linear-gradient(to right, var(--paper-dim), transparent);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: ""; position: absolute; top: 0; left: -40%;
  width: 40%; height: 100%; background: var(--paper);
  animation: sweep 2.4s var(--ease) infinite;
}
@keyframes sweep { to { left: 120%; } }
.scroll-hint.hidden { opacity: 0; }

/* Secaria header adapts to what's behind it (no photo darkening needed).
   Default = DARK ink (reads over the bright sky at the top of the page). */
.page-secaria .ui-top .brand-mark {
  filter: none;
  opacity: 0.82;
  transition: filter 0.55s var(--ease), opacity 0.4s var(--ease);
}
.page-secaria .ui-top .status {
  color: rgba(23, 22, 15, 0.72);
  text-shadow: 0 1px 12px rgba(244, 242, 236, 0.55);
  transition: color 0.55s var(--ease), text-shadow 0.55s var(--ease);
}
.page-secaria .ui-top .lang { text-shadow: 0 1px 12px rgba(244, 242, 236, 0.55); }
.page-secaria .ui-top .lang,
.page-secaria .ui-top .lang button { color: rgba(23, 22, 15, 0.45); transition: color 0.55s var(--ease); }
.page-secaria .ui-top .lang button:hover,
.page-secaria .ui-top .lang button.active { color: rgba(23, 22, 15, 0.92); }
.page-secaria .ui-top .lang .sep { opacity: 0.55; }

/* When a dark render sits behind the header, flip to WHITE */
.page-secaria .ui-top.on-dark .brand-mark {
  filter: invert(1) brightness(2.2) drop-shadow(0 1px 10px rgba(0,0,0,0.45));
  opacity: 0.94;
}
.page-secaria .ui-top.on-dark .status { color: var(--paper-dim); text-shadow: var(--tshadow); }
.page-secaria .ui-top.on-dark .lang { text-shadow: var(--tshadow); }
.page-secaria .ui-top.on-dark .lang,
.page-secaria .ui-top.on-dark .lang button { color: var(--paper-faint); }
.page-secaria .ui-top.on-dark .lang button:hover,
.page-secaria .ui-top.on-dark .lang button.active { color: var(--paper); }

/* =========================================================
   Typography
   ========================================================= */
.display {
  font-family: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-optical-sizing: auto;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 500;
  color: var(--paper-dim);
  text-shadow: var(--tshadow);
  margin-bottom: 1.5rem;
}

/* =========================================================
   ORA landing — super minimal: centred logo + one link
   ========================================================= */
body.landing-min {
  background: #FFFFFF;
  color: var(--ink);
}
.map-stage {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 3vh 3vw;
  overflow: hidden;
}
/* Positioning context so the ORA logo overlays the map's north (desktop + mobile) */
.map-holder { position: relative; }
.ro-map {
  width: min(94vw, 96vh, 1180px);
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  overflow: visible;
}
.ro-outline {
  fill: #E9E4D8;
  stroke: #DBD4C5;
  stroke-width: 1;
}

/* markers */
.mk text { font-family: 'Inter', system-ui, sans-serif; }
.mk-buc circle { fill: #B7AF9D; }
.mk-buc text {
  font-size: 12px;
  fill: rgba(23, 22, 15, 0.5);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mk-sec { cursor: pointer; }
.mk-sec .pin { fill: #A9603F; transition: r 0.3s var(--ease); }
.mk-sec .ring {
  fill: #A9603F;
  transform-box: fill-box;
  transform-origin: center;
  animation: pinpulse 2.6s ease-out infinite;
}
@keyframes pinpulse {
  0%   { transform: scale(0.5); opacity: 0.55; }
  100% { transform: scale(3.4); opacity: 0; }
}
.mk-sec .sec-eyebrow {
  font-size: 10px;
  fill: rgba(23, 22, 15, 0.45);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.mk-sec .sec-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  fill: var(--ink);
  transition: fill 0.3s var(--ease);
}
.mk-sec:hover .pin { r: 6; }

/* route + moving dot */
#route {
  fill: none;
  stroke: #A9603F;
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.show-route #route {
  opacity: 0.9;
  animation: routedraw 1.15s var(--ease) forwards;
}
@keyframes routedraw { to { stroke-dashoffset: 0; } }

#route-dot { fill: #8A4A31; opacity: 0; }
.show-route #route-dot {
  opacity: 1;
  animation: routetravel 1.15s var(--ease) forwards;
}
@keyframes routetravel { to { offset-distance: 100%; } }

/* ETA badge */
.eta { opacity: 0; transition: opacity 0.4s var(--ease) 0.25s; }
.show-route .eta { opacity: 1; }
.eta rect { fill: #17160F; }
.eta text {
  fill: #F1ECE2;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* centred ORA logo */
.map-logo {
  position: absolute;
  top: 26%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.map-logo img {
  width: clamp(94px, 10.5vw, 148px);
  height: auto;
  display: block;
}
.map-logo .sub {
  margin-top: 0.85rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  color: rgba(23, 22, 15, 0.5);
}

/* ---------- Mobile caption under the map (hidden on desktop) ---------- */
.landing-lede { display: none; }
.ll-eyebrow {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 500;
  color: rgba(23, 22, 15, 0.42);
}
.ll-name {
  margin-top: 0.55rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.9rem, 8.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.ll-place {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: rgba(23, 22, 15, 0.5);
}
.ll-cta {
  margin-top: 1.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(23, 22, 15, 0.28);
  padding-bottom: 0.55em;
}
.ll-arrow { color: #A9603F; transition: transform 0.4s var(--ease); }
.ll-cta:active .ll-arrow { transform: translateX(4px); }

@media (max-width: 640px) {
  /* ---------------------------------------------------------------
     Mobile landing — minimal. White ground, a BIG Romania, a single
     pulsing pin at Secaria. The ORA logo stays up top, overlaid on the
     map's north (just like the web), only a touch smaller. Below the
     map: the location — whose name is itself the underlined link.
     Column: [map + overlaid logo] → caption.
     --------------------------------------------------------------- */
  .map-stage {
    flex-direction: column;
    justify-content: center;
    gap: clamp(1.1rem, 3.4svh, 2rem);
    padding: 5svh 6vw;
  }

  /* Big country — the hero */
  .ro-map { width: min(94vw, 62svh, 480px); }

  /* ORA logo — kept absolute (from desktop), overlaid on the map's north,
     just a bit smaller than the web */
  .map-logo { top: 25%; }
  .map-logo img { width: clamp(60px, 12svh, 80px); }
  .map-logo .sub { margin-top: 0.5rem; }

  /* Only the country + its pulsing pin. No route, no capital dot, no ETA. */
  .mk-sec .sec-eyebrow,
  .mk-sec .sec-name { display: none; }
  .mk-sec .pin { r: 10; }
  .mk-sec .ring { r: 10; }
  .mk-buc,
  #route,
  #route-dot,
  .eta { display: none; }

  .landing-lede {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .ll-name { margin-top: 0.45rem; font-size: clamp(1.9rem, 7.8vw, 2.5rem); }
  /* The location name IS the link — directly underlined, terracotta accent */
  .ll-name a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 7px;
    text-decoration-color: rgba(169, 96, 63, 0.65);
    transition: text-decoration-color 0.35s var(--ease);
  }
  .ll-name a:active { text-decoration-color: #A9603F; }
  .ll-place { margin-top: 0.7rem; }
}

/* Lock the LANDING PAGE ONLY to one screen (no scroll) on portrait phones.
   Scoped to body.landing-min so the scrolling Secaria page is never affected. */
@media (max-width: 640px) and (orientation: portrait) {
  body.landing-min { height: 100svh; overflow: hidden; }
  body.landing-min .map-stage { height: 100svh; min-height: 0; }
}

/* =========================================================
   Secaria — scrolling narrative
   ========================================================= */
main.story { position: relative; z-index: 10; }

.chapter {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 22vh var(--gutter);
}
.chapter-hero { align-items: flex-end; padding-bottom: 15vh; }
.chapter-final { align-items: center; }

.chapter-inner { max-width: 60rem; width: 100%; }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }
.in-view .reveal { opacity: 1; transform: none; }

h1.display {
  font-size: var(--fs-display);
  line-height: 0.94;
  letter-spacing: -0.02em;
  text-shadow: var(--tshadow);
}
h1.display .line { display: block; }
h1.display .line-sub {
  font-weight: 400;
  color: var(--bone);
  opacity: 0.94;
}

.lede {
  margin-top: 1.8rem;
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  font-weight: 400;
  line-height: 1.55;
  color: var(--paper);
  text-shadow: var(--tshadow);
  max-width: 36ch;
}

.statement {
  font-size: var(--fs-statement);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-shadow: var(--tshadow);
}
.statement em { font-style: italic; color: var(--sand); }

h2.display { font-size: var(--fs-h2); line-height: 1.02; letter-spacing: -0.015em; text-shadow: var(--tshadow); }

.ghost-link {
  display: inline-block;
  margin-top: 1.8rem;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  color: var(--paper);
  text-decoration: none;
  text-shadow: var(--tshadow);
  padding-bottom: 0.35em;
  border-bottom: 1px solid rgba(246,243,236,0.4);
  transition: border-color 0.4s var(--ease);
}
.ghost-link:hover { border-color: var(--paper); }

/* ---------- Newsletter ---------- */
.signup { margin-top: 2.4rem; max-width: 30rem; }
.signup-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(246,243,236,0.45);
  padding-bottom: 0.7rem;
  transition: border-color 0.4s var(--ease);
}
.signup-row:focus-within { border-color: var(--paper); }

.signup input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--paper);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.signup input::placeholder { color: var(--paper-faint); }

.signup button {
  display: inline-flex; align-items: center; gap: 0.5em;
  background: none; border: none; cursor: pointer;
  color: var(--paper);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
  transition: opacity 0.35s var(--ease);
}
.signup button:hover { opacity: 0.7; }
.signup button .btn-arrow { transition: transform 0.4s var(--ease); }
.signup button:hover .btn-arrow { transform: translateX(4px); }

.signup-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  min-height: 1.2em;
  color: var(--sand);
  text-shadow: var(--tshadow);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.signup-note.show { opacity: 1; transform: none; }
.signup-note.error { color: #E7B79A; }

.signup.done .signup-row { opacity: 0.4; pointer-events: none; }

.colophon {
  margin-top: 4rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 500;
  color: var(--paper-dim);
  text-shadow: var(--tshadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .chapter { padding: 18vh var(--gutter); }
  .lede { max-width: 100%; }
  .ui-bottom .scroll-hint { display: none; }
  .meta-value { font-size: 0.74rem; }
  .landing-role { letter-spacing: 0.3em; }

  /* Let statements/lede flow naturally instead of breaking at desktop-tuned points */
  .statement br,
  .lede br { display: none; }

  /* Newsletter: prevent the input from overflowing its flex row on narrow screens */
  .signup { max-width: 100%; }
  .signup input { min-width: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
  .frame { transform: none !important; }
  .reveal { transition-duration: 0.4s; }
}
