/* ============================================================
   psyn.app — stylesheet
   Dark, minimal, typographic. System fonts. No external deps.
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --midnight-canvas:    #0a0e14;
  --midnight-card:      #131820;
  --midnight-elevated:  #1a1f29;
  --midnight-popover:   #212733;
  --frost-white:        #e6e8eb;
  --frost-secondary:    #cdd0d6;
  --frost-tertiary:     #959aa3;
  --frost-disabled:     #5c6370;
  --comment-gray:       #65737e;
  --function-blue:      #86c0ff;
  --brand:              #3178C6;
  --brand-light:        #4a90d9;
  --error-coral:        #ec5f67;
  --variable-teal:      #5fb3b3;
  --color-success:      #22c55e;
  --color-warning:      #f59e0b;
  --color-danger:       #dc2626;

  --font-ui:   -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', Monaco, Consolas, 'Courier New', monospace;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-pill: 100px;

  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);

  --content-width: 1100px;
  --content-padding: 24px;

  scroll-behavior: smooth;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--midnight-canvas);
  color: var(--frost-white);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--function-blue);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: var(--frost-white);
}

a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

img, svg {
  display: block;
}

ul {
  list-style: none;
}

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

/* ── Layout utilities ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

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

/* ── Typography scale ───────────────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--comment-gray);
}

.eyebrow--brand {
  color: var(--brand);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn--primary:hover {
  background-color: var(--brand-light);
  border-color: var(--brand-light);
  color: #fff;
}

.btn--ghost {
  background-color: transparent;
  color: var(--frost-secondary);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--frost-white);
}

.btn--sm {
  padding: 7px 14px;
  font-size: 0.875rem;
}

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

.text-link {
  color: var(--function-blue);
  font-size: 0.9375rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-link:hover {
  color: var(--frost-white);
  text-decoration: underline;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background-color: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.site-logo a {
  display: flex;
  align-items: center;
  opacity: 1;
}

.site-logo a:hover {
  opacity: 0.85;
}

.site-logo svg {
  height: 32px;
  width: auto;
}

/* Nav */
.site-nav {
  display: none; /* hidden on mobile */
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  font-size: 0.9rem;
  color: var(--frost-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--frost-white);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Header CTA */
.header-cta {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .site-nav {
    display: flex;
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 767px) {
  .site-header {
    height: 56px;
  }

  .header-cta .btn {
    padding: 7px 14px;
    font-size: 0.875rem;
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-block: 80px;
  background-color: var(--midnight-canvas);

  /* Subtle dot-grid overlay */
  background-image: radial-gradient(rgba(49, 120, 198, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center center;
}

.hero__inner {
  max-width: 720px;
}

.hero__eyebrow {
  margin-bottom: 24px;
}

.hero__headline {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--frost-white);
  margin-bottom: 24px;
}

/* Subtle accent on the period */
.hero__headline .period {
  color: var(--brand);
}

.hero__subtext {
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.75;
  color: var(--frost-secondary);
  max-width: 560px;
  margin-bottom: 40px;
}

.hero__ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================================
   MIRU PRODUCT SECTION
   ============================================================ */
.miru-section {
  background-color: var(--midnight-card);
  padding-block: 96px;
}

.miru-section__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}

.miru-section__content .eyebrow {
  margin-bottom: 20px;
}

.miru-section__headline {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--frost-white);
  margin-bottom: 20px;
}

.miru-section__body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--frost-secondary);
  margin-bottom: 16px;
}

.miru-section__tagline {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--frost-tertiary);
  margin-bottom: 32px;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.03);
  border-left: 2px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Abstract visual card */
.miru-section__visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background-color: var(--midnight-elevated);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}

.miru-section__visual-inner {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(49, 120, 198, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 80% 20%, rgba(134, 192, 255, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(26, 31, 41, 0.9) 0%, transparent 70%),
    linear-gradient(160deg, #1a1f29 0%, #0d1117 100%);
}

/* Model name labels floating in the visual */
.miru-section__visual-labels {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 24px;
  gap: 6px;
}

.miru-section__model-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--comment-gray);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.miru-section__model-tag::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  flex-shrink: 0;
}

.miru-section__model-tag--active {
  color: var(--brand);
}

/* Feature highlights */
.miru-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 64px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.miru-feature {
  background-color: var(--midnight-card);
  padding: 28px 32px;
}

.miru-feature__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.miru-feature__heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--frost-white);
  margin-bottom: 6px;
}

.miru-feature__body {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--frost-secondary);
}

@media (min-width: 768px) {
  .miru-features {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .miru-section__layout {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }
}

/* ============================================================
   VALUES / HOW WE BUILD
   ============================================================ */
.values-section {
  background-color: var(--midnight-canvas);
  padding-block: 96px;
}

.values-section__header {
  margin-bottom: 56px;
}

.values-section__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--frost-white);
  margin-bottom: 10px;
}

.values-section__intro {
  font-size: 1.0625rem;
  color: var(--frost-secondary);
}

.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.value-block {
  padding: 36px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.value-block:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.value-block__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--comment-gray);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.value-block__heading {
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--frost-white);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.value-block__body {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--frost-secondary);
  max-width: 480px;
}

@media (min-width: 768px) {
  .values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 80px;
  }

  .value-block {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: none;
  }

  /* Reset last-child border since we have a grid */
  .value-block:last-child {
    border-bottom: none;
  }

  /* Bottom borders for last row */
  .value-block:nth-last-child(-n+2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-section {
  background-color: var(--midnight-elevated);
  padding-block: 96px;
}

.about-section__inner {
  max-width: 640px;
}

.about-section__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--frost-white);
  margin-bottom: 24px;
}

.about-section__body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--frost-secondary);
}

.about-section__body + .about-section__body {
  margin-top: 20px;
}

.about-section__attribution {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--frost-tertiary);
  margin-top: 32px;
}

.about-section__wordmark {
  margin-top: 48px;
}

.about-section__wordmark svg {
  height: 36px;
  width: auto;
}

/* ============================================================
   CONTACT / SUPPORT
   ============================================================ */
.contact-section {
  background-color: var(--midnight-card);
  padding-block: 96px;
}

.contact-section__header {
  margin-bottom: 48px;
}

.contact-section__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--frost-white);
  margin-bottom: 10px;
}

.contact-section__intro {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--frost-secondary);
}

/* Form wrapper — constrains form width */
.contact-form-wrap {
  max-width: 600px;
}

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--frost-secondary);
  letter-spacing: 0.01em;
}

.form-field label .req {
  color: var(--brand);
  margin-left: 2px;
  font-size: 0.75em;
}

.form-field input,
.form-field select,
.form-field textarea {
  background-color: var(--midnight-elevated);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md);
  color: var(--frost-white);
  padding: 11px 14px;
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2365737e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--frost-tertiary);
}

.form-field select option {
  background-color: var(--midnight-elevated);
  color: var(--frost-white);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(49, 120, 198, 0.18);
}

/* Validation error state */
.form-field--error input,
.form-field--error select,
.form-field--error textarea {
  border-color: var(--error-coral);
}

.form-field__error {
  font-size: 0.8125rem;
  color: var(--error-coral);
  display: none;
}

.form-field--error .form-field__error {
  display: block;
}

/* Optional field note */
.form-field__hint {
  font-size: 0.8125rem;
  color: var(--frost-tertiary);
}

/* Submit row */
.form-submit-row {
  margin-top: 4px;
}

/* Form feedback states */
.form-feedback {
  display: none;
  padding: 24px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.form-feedback--success {
  background-color: rgba(49, 120, 198, 0.1);
  border: 1px solid rgba(49, 120, 198, 0.25);
  color: var(--frost-secondary);
}

.form-feedback--success strong {
  display: block;
  font-size: 1.0625rem;
  color: var(--frost-white);
  margin-bottom: 8px;
}

.form-feedback--success .ticket-id {
  font-family: var(--font-mono);
  color: var(--function-blue);
}

.form-feedback--error {
  background-color: rgba(236, 95, 103, 0.08);
  border: 1px solid rgba(236, 95, 103, 0.25);
  color: var(--frost-secondary);
}

.form-feedback--error strong {
  display: block;
  color: var(--error-coral);
  margin-bottom: 8px;
}

.form-feedback--error a {
  color: var(--function-blue);
  text-decoration: underline;
}

.form-feedback[aria-hidden="false"] {
  display: block;
}

@media (min-width: 600px) {
  .form-row--two {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--midnight-canvas);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-block: 52px;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

/* Icon mark */
.footer-icon svg {
  height: 28px;
  width: auto;
  opacity: 0.6;
}

/* Footer nav */
.footer-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--frost-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.footer-nav a:hover {
  color: var(--frost-secondary);
}

/* Separator dots */
.footer-nav li + li::before {
  content: '·';
  color: var(--comment-gray);
  margin-right: 8px;
}

/* Privacy note */
.footer-privacy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--comment-gray);
  letter-spacing: 0.01em;
}

/* Copyright */
.footer-legal {
  font-size: 0.8125rem;
  color: var(--frost-tertiary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
}

.footer-legal a {
  color: var(--frost-tertiary);
  font-size: 0.8125rem;
}

.footer-legal a:hover {
  color: var(--frost-secondary);
}

/* ============================================================
   SECTION DIVIDERS — visual rhythm via background alternation
   Sections alternate: canvas / card / canvas / elevated / card
   No explicit dividers needed — spacing and background carry it.
   ============================================================ */

/* Section title shared styles */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--frost-white);
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */

/* Loading spinner for form submit */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Focus ring — global, applied only on keyboard nav */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Smooth scroll target offset — compensates for sticky header */
section[id] {
  scroll-margin-top: 72px;
}
