/*
Theme Name: Noctyr
Theme URI: https://noctyr.co.uk
Author: Noctyr Ltd
Description: Single-screen, no-scroll coming-soon page for Noctyr Ltd, a private security and close protection company.
Version: 2.1.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: noctyr
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  color-scheme: dark;
  --background: #0b0d0e;
  --surface: #111416;
  --surface-raised: #15181a;
  --text-primary: #f1efe9;
  --text-secondary: #aaa69d;
  --text-muted: #79766e;
  --border: rgba(241, 239, 233, 0.16);
  --border-strong: rgba(241, 239, 233, 0.32);
  --accent: #8d877b;
  --accent-bright: #c9c3b4;
  --error: #d98a7b;
  --error-surface: rgba(217, 138, 123, 0.1);
  --success: #a9c2ac;
  --focus: #c9c3b4;

  --font-display: Optima, Candara, "Noto Sans", "Segoe UI", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --form-width: 400px;
  --radius: 3px;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

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

/* The hidden attribute must always win over any class's own `display`
   rule (e.g. `.noctyr-step { display: flex }`) — author CSS otherwise
   overrides the UA stylesheet's [hidden] rule regardless of specificity. */
[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; }

h1, p, fieldset { margin: 0; }

button { font-family: inherit; }

input, select, textarea { font-family: inherit; font-size: 1rem; }

/* Background texture: restrained radial light, CSS-only */
body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(241, 239, 233, 0.06), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(141, 135, 123, 0.05), transparent 60%);
  background-attachment: fixed;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  background: var(--surface-raised);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  z-index: 1000;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Full-width launch ribbon: no offsets or transforms, so it stays perfectly
   centred and unclipped at every viewport width. */
.noctyr-launch-ribbon {
  position: relative;
  z-index: 100;
  width: 100%;
  flex: 0 0 auto;
  padding: 0.7rem clamp(1rem, 4vw, 2rem);
  background: var(--accent-bright);
  border-block: 1px solid rgba(11, 13, 14, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  color: var(--background);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

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

/* ==========================================================================
   Single screen layout
   ========================================================================== */

.noctyr-screen {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3svh, 2rem) clamp(1rem, 4vw, 1.5rem);
}

.noctyr-card {
  width: 100%;
  min-width: 0; /* flex items default to min-width:auto, which floors
                   width at content size and silently overflows instead
                   of shrinking — this is what let content overflow on
                   narrow screens instead of wrapping. */
  max-width: var(--form-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.55rem, 1.6svh, 0.65rem);
}

.noctyr-logo {
  display: inline-flex;
  max-width: 100%;
  padding: 0.25rem;
}

.noctyr-logo img {
  height: clamp(130px, 25svh, 220px);
  width: auto;
}

.noctyr-coming-soon {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 4.5svh, 2.1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  max-width: 100%;
}

.noctyr-subline {
  font-size: clamp(0.82rem, 1.8svh, 0.92rem);
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: min(40ch, 100%);
  margin-top: -0.2rem;
  margin-bottom: 0.2rem;
}

/* Eyebrow label announcing each block, so the form and the direct-contact
   options read as two distinct, clearly separated actions. */
.noctyr-panel-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: clamp(0.5rem, 1.4svh, 0.75rem);
}

.noctyr-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.noctyr-divider::before,
.noctyr-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.noctyr-contact {
  width: 100%;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--text-primary) 60%);
  color: var(--background);
  border-color: var(--accent-bright);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  width: 100%;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(180deg, #ffffff, var(--accent-bright) 60%);
  border-color: #ffffff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  flex: 1;
  min-width: 0;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--accent-bright);
  background: var(--surface-raised);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ==========================================================================
   Form
   ========================================================================== */

.noctyr-form-wrap {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: clamp(0.9rem, 2.6svh, 1.05rem);
  text-align: left;
}

.noctyr-password-screen .noctyr-card {
  max-width: 360px;
}

.noctyr-password-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.noctyr-password-form .noctyr-form__submit {
  margin-top: 0;
}

.noctyr-password-form .btn-primary {
  width: 100%;
}

.noctyr-panel-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: clamp(0.5rem, 1.4svh, 0.65rem);
}

.noctyr-form-wrap .noctyr-panel-label {
  margin-bottom: 0;
}

.noctyr-step-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.noctyr-step-indicator {
  grid-column: 2;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.noctyr-form {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.noctyr-step {
  display: flex;
  flex-direction: column;
  gap: clamp(1.15rem, 3svh, 1.5rem);
}

.noctyr-back-btn {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0.5rem 0.5rem 0;
  min-height: 44px;
  min-width: 44px;
}

.noctyr-back-btn:hover,
.noctyr-back-btn:focus-visible {
  color: var(--text-primary);
}

.noctyr-back-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.noctyr-field { display: flex; flex-direction: column; gap: 0.5rem; }

.noctyr-field label,
.noctyr-field legend {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0;
}

.noctyr-field input[type="text"],
.noctyr-field input[type="email"],
.noctyr-field input[type="tel"],
.noctyr-field input[type="number"],
.noctyr-field input[type="date"],
.noctyr-field select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  color-scheme: dark;
  padding: 0.55rem 0.75rem;
  font-size: 1rem; /* prevents unwanted mobile zoom */
  line-height: 1.4;
  width: 100%;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.noctyr-field input::placeholder {
  color: var(--text-muted);
}

.noctyr-field input:focus,
.noctyr-field select:focus {
  border-color: var(--accent-bright);
  background: var(--surface-raised);
}

.noctyr-field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23aaa69d' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.noctyr-field__error {
  font-size: 0.75rem;
  color: var(--error);
  line-height: 1.4;
  display: none;
}

.noctyr-field.has-error input,
.noctyr-field.has-error select {
  border-color: var(--error);
}

.noctyr-field.has-error .noctyr-field__error {
  display: block;
}

/* Segmented control */
.noctyr-segmented {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.noctyr-segmented__options {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}

.noctyr-segmented__option {
  position: relative;
  flex: 1;
  min-width: 0;
}

.noctyr-segmented__option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.noctyr-segmented__option label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.5rem 0.5rem;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  cursor: pointer;
  border-right: 1px solid var(--border-strong);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.noctyr-segmented__option:last-child label { border-right: none; }

.noctyr-segmented__option input:checked + label {
  background: var(--accent);
  color: var(--background);
}

.noctyr-segmented__option input:checked + label::before {
  content: "✓ ";
}

.noctyr-segmented__option input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}

/* Honeypot: hidden from genuine users, still in tab order removed */
.noctyr-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.noctyr-form__submit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.noctyr-form__status {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: center;
}

.noctyr-form__server-error {
  border: 1px solid var(--error);
  background: var(--error-surface);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: none;
}

.noctyr-form__server-error.is-visible { display: block; }

.noctyr-form__server-error p {
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.4;
}

.noctyr-privacy-note {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Success panel */
.noctyr-success {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--surface);
  text-align: center;
}

.noctyr-success__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.noctyr-success p:not(.noctyr-success__eyebrow) {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.88rem;
}

/* ==========================================================================
   Contact buttons
   ========================================================================== */

.noctyr-contact-buttons {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

/* ==========================================================================
   Mini footer
   ========================================================================== */

.noctyr-mini-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 0.5rem 1rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.noctyr-mini-footer p {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 400px) {
  .noctyr-launch-ribbon {
    padding-block: 0.6rem;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
  }

  .noctyr-contact-buttons {
    flex-direction: column;
  }
}

@media (max-height: 860px) {
  .noctyr-logo img {
    height: clamp(96px, 18svh, 145px);
  }
  .noctyr-coming-soon {
    font-size: clamp(1rem, 3.2svh, 1.4rem);
    letter-spacing: 0.03em;
    line-height: 1.2;
  }
  .noctyr-subline {
    display: none;
  }
  .noctyr-card {
    gap: 0.22rem;
  }
  .noctyr-form-wrap {
    padding: 0.45rem;
  }
  .noctyr-panel-head {
    margin-bottom: 0.25rem;
  }
  .noctyr-step {
    gap: 0.9rem;
  }
  .noctyr-privacy-note {
    margin-top: 0.2rem;
  }
  .noctyr-mini-footer {
    margin-top: 0.2rem;
  }
}

@media (max-height: 620px) {
  .noctyr-panel-label {
    display: none;
  }
  .noctyr-divider {
    display: none;
  }
  .noctyr-logo img {
    height: clamp(72px, 14svh, 96px);
  }
  .noctyr-coming-soon {
    font-size: clamp(1rem, 3svh, 1.3rem);
  }
  .noctyr-card {
    gap: 0.2rem;
  }
  .noctyr-form-wrap {
    padding: 0.4rem;
  }
  .noctyr-step {
    gap: 0.7rem;
  }
  .btn {
    padding: 0.6rem 1.25rem;
  }
  .noctyr-mini-footer {
    margin-top: 0.25rem;
  }
  .noctyr-mini-footer p {
    font-size: 0.62rem;
  }
}

/* ==========================================================================
   Product media — sales stills and flow reels on /preview/
   ========================================================================== */

.noctyr-launch {
  min-height: calc(100svh - 3.2rem);
  display: flex;
  flex-direction: column;
}

.noctyr-launch .noctyr-screen {
  flex: 1;
}

.noctyr-product {
  width: 100%;
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1rem, 4vw, 2rem) 3.25rem;
  border-top: 1px solid var(--border);
}

.noctyr-product__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.noctyr-product h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.8vw, 1.65rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.noctyr-product__lede {
  margin: 0 0 1.75rem;
  max-width: 54ch;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.noctyr-product__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.noctyr-product__ops {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(12rem, 0.65fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1.75rem;
}

.noctyr-shot {
  margin: 0;
}

.noctyr-shot__frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #050607;
  aspect-ratio: 16 / 10;
}

.noctyr-shot__frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.noctyr-shot__frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.noctyr-shot figcaption {
  margin-top: 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.noctyr-shot--phone .noctyr-shot__frame {
  max-width: 280px;
  margin-inline: auto;
  aspect-ratio: 9 / 16;
}

.noctyr-product__reel-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #050607;
  aspect-ratio: 16 / 10;
}

.noctyr-product__reel {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.noctyr-product + .noctyr-mini-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 0;
}

@media (max-width: 800px) {
  .noctyr-product__grid,
  .noctyr-product__ops {
    grid-template-columns: 1fr;
  }

  .noctyr-shot--phone .noctyr-shot__frame {
    max-width: 220px;
  }
}

@media (max-height: 860px) {
  .noctyr-product .noctyr-panel-label {
    display: block;
  }
}

@media (max-height: 620px) {
  .noctyr-product .noctyr-panel-label,
  .noctyr-product h2 {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .noctyr-product__reel-wrap {
    display: none;
  }
}

/* ==========================================================================
   Draft homepage — /preview/ only
   ========================================================================== */

.noctyr-preview-page {
  display: block;
  min-height: 100svh;
}

.noctyr-preview-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1rem, 5vw, 1.5rem) 0.5rem;
  text-align: center;
}

.noctyr-preview-logo {
  display: inline-flex;
  margin-bottom: 0.75rem;
}

.noctyr-preview-logo img {
  height: clamp(96px, 18svh, 160px);
  width: auto;
  margin-inline: auto;
}

.noctyr-preview-title {
  margin: 0.35rem 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 4.2vw, 2.3rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.noctyr-preview-lede {
  margin: 0 auto 1.5rem;
  max-width: 48ch;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.noctyr-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.noctyr-preview-copy {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 5vw, 1.5rem);
  text-align: left;
}

.noctyr-preview-copy p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.noctyr-preview-copy__title {
  margin: 0.35rem 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.noctyr-preview-copy__mark {
  margin: 0 0 1.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.noctyr-preview-copy__that {
  color: var(--text-primary) !important;
  font-weight: 500;
}

.noctyr-shot--wide {
  margin-top: 1.75rem;
}

.noctyr-preview-back {
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(1rem, 3vw, 1.5rem);
  text-align: center;
}

.noctyr-preview-back a {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
}

.noctyr-preview-back a:hover,
.noctyr-preview-back a:focus-visible {
  color: var(--text-primary);
}

@media (max-height: 860px) {
  .noctyr-preview-page .noctyr-panel-label,
  .noctyr-preview-page .noctyr-preview-title {
    display: block;
  }
}

@media (max-height: 620px) {
  .noctyr-preview-page .noctyr-panel-label,
  .noctyr-preview-page h1,
  .noctyr-preview-page h2 {
    display: block;
  }
}
