/* ==========================================================================
   PINO coming soon
   One screen: the 3D bronze cone floats above a monumental "pino" wordmark, the
   brand logo brought to life. Holding the cone opens it like a ripe pine cone.
   --open (0..1) is set on <html> by coming-soon.js while the cone opens.
   Layers: wordmark 0, cone canvas 1, everything interactive 2.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin + latin-ext for ă â î ș ț) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --olive: #3F3E20;
  --bronze: #87744C;
  --cream: #F1E9DC;
  --bg: #262511;              /* deep olive night */
  --ink: var(--cream);
  --ink-soft: #D9D0BF;        /* 11:1 on --bg */
  --gold: #C9B183;            /* 8:1 on --bg */
  --line: rgb(241 233 220 / 0.24);
  --error: #F2C3AE;
  --logo-accent: var(--gold);

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --font-sans: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
  /* A warm pool of light behind the cone that brightens as it opens, and a soft vignette. */
  background-image:
    radial-gradient(ellipse 52% 48% at 50% 42%, color-mix(in srgb, #a5834f calc(var(--open, 0) * 34%), #4a4828) 0%, rgb(38 37 17 / 0) 72%),
    radial-gradient(ellipse 120% 85% at 50% 45%, rgb(0 0 0 / 0) 55%, rgb(10 10 4 / 0.55) 100%);
  color: var(--ink-soft);
  font: 400 1rem/1.7 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layers ---------- */
.cone-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.cone-ready .cone-canvas { opacity: 1; }
.no-webgl .cone-canvas { display: none; }

.cs {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}
.cs-copy, .cs-stage, .cs-control { position: relative; z-index: 2; }

/* ---------- Social links, top right ---------- */
.cs-top {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  padding: 1.25rem var(--gutter) 0;
}
.cs-social { display: flex; gap: 0.25rem; margin-right: -10px; }
.cs-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}
.cs-social a:hover { color: var(--gold); }
.cs-social svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- Main composition ---------- */
.cs-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy stage control"
    "word word  word";
  align-items: center;
  column-gap: clamp(1rem, 3vw, 3rem);
  min-height: 0;
  padding: clamp(1.5rem, 5vh, 3rem) var(--gutter) clamp(1.25rem, 4vh, 2.5rem);
}

@media (min-width: 861px) {
  /* The entrance slides the wordmark up from below; don't let it add a scrollbar. */
  .cs { overflow: clip; }
}

/* Copy: the closed and open panels cross-fade; only the active one takes up space. */
.cs-copy {
  grid-area: copy;
  position: relative;
  align-self: center;
}
.cs-panel {
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), visibility 0s linear 0.8s;
}
.cs-panel--open,
.is-open .cs-panel--closed {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.cs-panel--open { opacity: 0; visibility: hidden; transform: translateY(16px); }
.is-open .cs-panel--closed { opacity: 0; visibility: hidden; transform: translateY(-12px); }
.is-open .cs-panel--open {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.9s var(--ease) 0.3s, transform 0.9s var(--ease) 0.3s, visibility 0s;
}

.cs-title {
  max-width: 12.5ch;
  font: 400 clamp(2.25rem, 3.8vw, 3.75rem)/1.06 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.cs-title em { color: var(--gold); }
.cs-lead {
  max-width: 32ch;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

/* Stage: the cone slot. The canvas draws the cone here. */
.cs-stage {
  grid-area: stage;
  align-self: stretch;
  display: flex;
  min-height: 0;
}
.cs-cone {
  position: relative;
  flex: 1;
  min-height: 280px;
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.cs-cone__fallback { display: none; }
.no-webgl .cs-cone__fallback {
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: 62%;
  fill: var(--gold);
  transform: scale(calc(1 + var(--open, 0) * 0.08));
  transition: transform 0.2s linear;
}

/* Control: hold to open. */
.cs-control {
  grid-area: control;
  justify-self: end;
  display: grid;
  justify-items: start;
  gap: 0.85rem;
}

.cs-hold {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 1.5rem 0.5rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(241 233 220 / 0.06);
  color: var(--ink);
  font: 600 0.8125rem/1 var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.3s var(--ease);
}
.cs-hold:hover { border-color: var(--gold); }
.is-holding .cs-hold {
  background: rgb(241 233 220 / 0.12);
  border-color: var(--gold);
  transform: scale(0.98);
}
.cs-hold:disabled { cursor: default; transform: none; }

/* The ring fills with gold as the cone opens. */
.cs-hold__ring {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--open, 0) * 360deg), rgb(241 233 220 / 0.18) 0);
}
.cs-hold__core {
  display: grid;
  place-items: center;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  background: #2E2D17;
}
.cs-hold__core svg { width: 15px; height: auto; aspect-ratio: 43.5 / 52.2; fill: var(--gold); }

.cs-hold__hint {
  padding-left: 0.6rem;
  font: italic 400 1.25rem/1.2 var(--font-display);
  color: var(--ink-soft);
}

.cs-skip {
  margin-left: 0.6rem;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.cs-skip:hover { color: var(--ink); border-color: var(--gold); }

.is-open .cs-hold__hint,
.is-open .cs-skip { visibility: hidden; opacity: 0; }
.cs-hold__hint, .cs-skip { transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s; }

/* Wordmark: the logo's "pino" at monumental scale, sitting under the cone. */
.cs-wordmark {
  grid-area: word;
  justify-self: center;
  position: relative;
  z-index: 0;
  width: min(56vw, 84vh, 820px);
  margin-top: calc(-1 * clamp(0.75rem, 4vh, 2.5rem));
}
.cs-wordmark svg { width: 100%; height: auto; fill: var(--cream); }

/* ---------- Form (revealed once the cone opens) ---------- */
.cs-form { margin-top: 1.75rem; }
.cs-form label {
  display: block;
  margin-bottom: 0.5rem;
  font: 600 0.6875rem/1.2 var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.cs-form__row { display: flex; gap: 0.5rem; max-width: 26rem; }
/* Phone field: the fixed +373 prefix and the number share one pill. */
.cs-phone {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 3rem;
  border: 1px solid rgb(241 233 220 / 0.4);
  border-radius: 999px;
  background: rgb(241 233 220 / 0.08);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.cs-phone:focus-within { border-color: var(--gold); background: rgb(241 233 220 / 0.12); }
.cs-phone:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.cs-phone:has(input[aria-invalid="true"]) { border-color: var(--error); }
.cs-phone__prefix {
  padding: 0 0.4rem 0 1.1rem;
  font: 500 1rem/1 var(--font-sans);
  color: var(--gold);
  white-space: nowrap;
}
.cs-phone input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: calc(3rem - 2px);
  padding: 0 1.1rem 0 0;
  border: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
  color: var(--ink);
  font: 400 1rem/1 var(--font-sans);
  letter-spacing: 0.02em;
}
.cs-phone input::placeholder { color: rgb(241 233 220 / 0.6); }
.cs-phone input:focus { outline: none; }

.cs-btn {
  min-height: 3rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  color: var(--olive);
  font: 600 0.8125rem/1 var(--font-sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), transform 0.2s var(--ease);
}
.cs-btn:hover { background: #FBF6EE; }
.cs-btn:active { transform: scale(0.98); }
.cs-btn:disabled { opacity: 0.6; cursor: progress; }

/* Hidden from people, tempting to spam bots. */
.cs-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cs-privacy {
  max-width: 26rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.cs-privacy a { color: var(--ink); text-underline-offset: 2px; }
@media (max-width: 860px) {
  .cs-privacy { margin-inline: auto; }
}

.cs-form__error {
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: var(--error);
}
.cs-thanks {
  margin-top: 1.75rem;
  font: italic 400 1.5rem/1.3 var(--font-display);
  color: var(--gold);
}

/* Without JavaScript modules the form is shown straight away. */
.no-module .cs-panel--closed { display: none; }
.no-module .cs-panel--open { opacity: 1; visibility: visible; transform: none; }
.no-module .cs-control { display: none; }

/* ---------- Phones and narrow screens: one column, exactly one screen tall ---------- */
@media (max-width: 860px) {
  .cs { height: 100vh; height: 100dvh; }
  .cs-main {
    grid-template-columns: minmax(0, 1fr);
    /* The cone's row takes whatever height is left, so everything else always fits. */
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "copy" "stage" "word" "control";
    row-gap: clamp(0.35rem, 1.5vh, 0.85rem);
    padding-block: clamp(0.75rem, 3vh, 1.5rem) max(0.9rem, env(safe-area-inset-bottom));
    justify-items: center;
    text-align: center;
  }
  .cs-top { padding-top: 0.25rem; }
  .cs:has(.cs-social a) .cs-copy { padding-top: 2.25rem; }
  .cs-title, .cs-lead { margin-inline: auto; }
  .cs-title { max-width: 14ch; font-size: clamp(1.75rem, min(8.4vw, 4.8vh), 2.75rem); }
  .cs-lead { max-width: 36ch; margin-top: 0.6rem; font-size: 0.8125rem; line-height: 1.55; }
  .cs-stage { justify-self: stretch; }
  .cs-cone { min-height: 0; }
  .cs-wordmark { width: min(66vw, 80vh, 400px); margin-top: -0.5rem; }

  .cs-control { justify-self: center; justify-items: center; gap: 0.3rem; }
  .cs-hold { padding: 0.375rem 1.25rem 0.375rem 0.375rem; }
  .cs-hold__ring { width: 2.75rem; height: 2.75rem; }
  .cs-hold__hint { display: none; }
  .cs-skip { margin-left: 0; }
  .is-open .cs-control { display: none; }

  .cs-form { margin-top: 0.9rem; }
  .cs-form__row, .cs-privacy { margin-inline: auto; }
  .cs-privacy { font-size: 0.6875rem; }
  .cs-thanks { margin-top: 1rem; }
}
@media (max-width: 400px) {
  /* Give the number room next to the button on narrow phones. */
  .cs-btn { padding: 0 1rem; letter-spacing: 0.06em; }
  .cs-phone__prefix { padding-left: 0.9rem; }
}
@media (max-width: 359px) {
  .cs-form__row { flex-direction: column; }
}
/* Small phones: drop the explanation so the cone keeps its room. */
@media (max-width: 860px) and (max-height: 600px) {
  .cs-panel--closed .cs-lead { display: none; }
}
/* Too short for one screen (a phone held sideways): let the page scroll. */
@media (max-width: 860px) and (max-height: 460px) {
  .cs { height: auto; }
  .cs-main { grid-template-rows: auto 260px auto auto; }
}

/* Short landscape screens: tighten the stack. */
@media (min-width: 861px) and (max-height: 700px) {
  .cs-title { font-size: clamp(2rem, 3.2vw, 3rem); }
  .cs-wordmark { width: min(50vw, 78vh, 820px); }
}

/* ---------- Entrance (only when the visitor allows motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .cs-top, .cs-copy, .cs-control {
    animation: rise 1.1s var(--ease) both;
  }
  .cs-copy { animation-delay: 0.25s; }
  .cs-control { animation-delay: 0.45s; }
  .cs-wordmark { animation: rise-far 1.6s var(--ease) both 0.1s; }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 860px) {
  /* On one-screen phones nothing slides in from below the fold (no scrollbar flash). */
  .cs-control { animation-name: fade; }
  .cs-wordmark { animation-name: rise; }
}

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise-far { from { opacity: 0; transform: translateY(60px); } }
