/* ==========================================================================
   CURTIS SERVICES — The chooser (homepage only)
   A full-viewport three-panel gate. The panel under the pointer (or holding
   keyboard focus) claims the space; the other two give way.
   Motion ported from the 21st.dev "Expand on hover" component.
   ========================================================================== */

.gate {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--void);
}

/* --------------------------------------------------------------------------
   Gate head
   -------------------------------------------------------------------------- */

.gate__head {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.1rem, 2.4vw, 2rem) var(--gutter) clamp(0.75rem, 1.6vw, 1.25rem);
}

.gate__mark {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gate__wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.gate__wordmark em {
  font-style: normal;
  color: var(--paper-42);
}

.gate__place {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-42);
}

.gate__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: right;
}

.gate__phone {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) var(--ease-out);
}
.gate__phone:hover { color: var(--c-removals); }

.gate__hint {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-42);
}

@media (max-width: 620px) {
  .gate__head { align-items: center; }
  .gate__hint { display: none; }
}

/* --------------------------------------------------------------------------
   The three panels
   -------------------------------------------------------------------------- */

.gate__panels {
  flex: 1;
  display: flex;
  gap: 6px;
  padding: 0 var(--gutter) clamp(1rem, 2vw, 1.75rem);
  min-height: 0;
}

.panel {
  --p: var(--paper);
  --p-ink: var(--void);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hair-soft);
  isolation: isolate;
  transition:
    flex-grow 0.75s var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}

.panel[data-brand-panel="removals"] { --p: var(--c-removals); --p-ink: #04220A; }
.panel[data-brand-panel="drone"]    { --p: var(--c-drone);    --p-ink: #2A0A00; }
.panel[data-brand-panel="erg"]      { --p: var(--c-erg);      --p-ink: #23280A; }

/* The give-and-take. Only on real pointers with room to play. */
@media (hover: hover) and (min-width: 900px) {
  .gate__panels:hover .panel,
  .gate__panels:focus-within .panel { flex-grow: 0.80; }

  /* Same specificity as the rule above, declared after it, so the chosen
     panel wins the cascade. Bare .panel:hover would lose. */
  .gate__panels .panel:hover,
  .gate__panels .panel:focus-within { flex-grow: 2.15; }
}

/* --- Panel layers ---------------------------------------------------------- */

/* Optional photograph. Drops in behind everything when a file is supplied. */
.panel__media {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.30;
  filter: grayscale(1) contrast(1.15);
  transform: scale(1.06);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    filter var(--dur-slow) var(--ease-out),
    transform 1.4s var(--ease-out);
}

.panel:hover .panel__media,
.panel:focus-within .panel__media {
  opacity: 0.52;
  filter: grayscale(0.35) contrast(1.05);
  transform: scale(1);
}

/* Accent wash rising from the floor of the panel */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 70% at 50% 116%,
      color-mix(in srgb, var(--p) 42%, transparent) 0%,
      color-mix(in srgb, var(--p) 10%, transparent) 38%,
      transparent 72%),
    linear-gradient(180deg, rgba(5, 6, 7, 0.55) 0%, transparent 32%, rgba(5, 6, 7, 0.82) 100%);
  opacity: 0.55;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.panel:hover::before,
.panel:focus-within::before { opacity: 1; }

/* Cursor spotlight — --mx/--my are written by js/chooser.js */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    22rem 22rem at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--p) 16%, transparent),
    transparent 70%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  pointer-events: none;
}

.panel:hover::after { opacity: 1; }

/* --- The oversized line glyph --------------------------------------------- */

.panel__glyph {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: -1;
  width: min(78%, 30rem);
  transform: translate(-50%, -50%) scale(0.92);
  color: var(--p);
  opacity: 0.16;
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform 1.2s var(--ease-out);
  pointer-events: none;
}

.panel:hover .panel__glyph,
.panel:focus-within .panel__glyph {
  opacity: 0.34;
  transform: translate(-50%, -50%) scale(1);
}

.panel__glyph [data-spin] { transform-box: fill-box; transform-origin: center; }

.panel:hover .panel__glyph [data-spin] { animation: rotor 1.1s linear infinite; }

@keyframes rotor { to { transform: rotate(360deg); } }

/* --- Panel index ---------------------------------------------------------- */

.panel__index {
  position: absolute;
  top: clamp(1rem, 2vw, 1.75rem);
  left: clamp(1rem, 2vw, 1.75rem);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--paper-42);
  transition: color var(--dur-fast) var(--ease-out);
}

.panel__index::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--p);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--p) 40%, transparent);
  transition: box-shadow var(--dur) var(--ease-out);
}

.panel:hover .panel__index { color: var(--paper-80); }
.panel:hover .panel__index::before { box-shadow: 0 0 0 7px color-mix(in srgb, var(--p) 14%, transparent); }

/* --- Panel body ----------------------------------------------------------- */

.panel__body {
  position: relative;
  z-index: 3;
  padding: clamp(1.25rem, 2.4vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.panel__kicker {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--p);
}

.panel__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vw, 4.4rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* Size the title against the panel rather than the viewport, so a panel that
   gives way narrows its word instead of clipping it. The vw rule above stays
   as the fallback wherever container queries are missing. */
@supports (container-type: inline-size) {
  .panel { container-type: inline-size; }

  .panel__title { font-size: clamp(1.55rem, 15cqw, 4.6rem); }

  .panel__kicker { font-size: clamp(0.5rem, 2.1cqw, 0.75rem); }
}

/* Everything below the title is held back until the panel is chosen. */
.panel__reveal {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 0.7s var(--ease-out),
    opacity 0.5s var(--ease-out);
}

.panel__reveal > div { min-height: 0; overflow: hidden; }

@media (hover: hover) and (min-width: 900px) {
  .panel__reveal { grid-template-rows: 0fr; opacity: 0; }

  .panel:hover .panel__reveal,
  .panel:focus-within .panel__reveal {
    grid-template-rows: 1fr;
    opacity: 1;
    transition-delay: 0.08s;
  }
}

.panel__blurb {
  font-size: var(--t-small);
  line-height: 1.5;
  color: var(--paper-80);
  max-width: 34ch;
  padding-top: 0.35rem;
}

.panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.panel__tags li {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--p) 34%, transparent);
  background: color-mix(in srgb, var(--p) 8%, transparent);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-80);
  white-space: nowrap;
}

.panel__enter {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.35rem;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--p);
}

.panel__enter svg {
  width: 0.95rem; height: 0.95rem;
  transition: transform var(--dur-fast) var(--ease-out);
}
.panel:hover .panel__enter svg { transform: translateX(5px); }

/* The whole panel is one link. The anchor covers it; the visuals sit behind. */
.panel__hit {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
}

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

.panel:focus-within { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--p) 60%, transparent); }
.panel__hit:focus-visible { outline: none; }

/* --- Stacked layout ------------------------------------------------------- */

@media (max-width: 899px) {
  .gate { min-height: auto; }

  .gate__panels {
    flex-direction: column;
    gap: 10px;
  }

  .panel {
    flex: none;
    min-height: clamp(15rem, 30svh, 20rem);
  }

  .panel__title { font-size: clamp(1.75rem, 9cqw, 2.75rem); }
  .panel__kicker { font-size: var(--t-mono); }
  .panel__tags { display: none; }

  /* Stacked cards have no room for the glyph beside the copy, so it becomes a
     watermark bleeding off the right edge and the text runs full width. */
  .panel__glyph {
    left: auto;
    right: -14%;
    top: 50%;
    width: min(56%, 14rem);
    opacity: 0.12;
    transform: translateY(-50%);
  }

  .panel:hover .panel__glyph,
  .panel:focus-within .panel__glyph { opacity: 0.17; transform: translateY(-50%); }
}

@media (max-width: 480px) {
  .panel__blurb { font-size: 0.8125rem; max-width: 30ch; }
}

/* --------------------------------------------------------------------------
   Scroll cue
   -------------------------------------------------------------------------- */

.gate__cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0 var(--gutter) clamp(1rem, 2vw, 1.5rem);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-24);
}

.gate__cue svg { width: 0.85rem; height: 0.85rem; animation: nudge 2.6s var(--ease-io) infinite; }

@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* --------------------------------------------------------------------------
   "One operator" section below the gate
   -------------------------------------------------------------------------- */

.operator {
  position: relative;
  background: var(--ink);
  border-top: 1px solid var(--hair-soft);
}

.operator__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

@media (min-width: 900px) {
  .operator__grid { grid-template-columns: 1.15fr 0.85fr; }
}

.operator__lede {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

/* Must be a class, not a bare `span`: the word-splitter in main.js wraps every
   word in a span, so a descendant-span selector would dim the whole heading. */
.operator__lede .dim { color: var(--paper-42); }

.operator__copy { margin-top: 1.75rem; display: grid; gap: 1rem; }

.creds {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--hair);
}

.creds li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hair-soft);
}

.creds dt,
.creds__k {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-42);
}

.creds__v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  letter-spacing: -0.02em;
  text-align: right;
}

/* Three-colour rule used as a section divider */
.tricolour {
  display: flex;
  height: 4px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
}
.tricolour i { flex: 1; }
.tricolour i:nth-child(1) { background: var(--c-removals); }
.tricolour i:nth-child(2) { background: var(--c-drone); }
.tricolour i:nth-child(3) { background: var(--c-erg); }
