/* ==========================================================================
   nameorigin.io — Phase 0 Design System
   Pure CSS, no frameworks. 8px grid. Accessible contrast.
   ========================================================================== */

/* --------------------------------------------------------------------------
   DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary: #0d5c63;
  --color-primary-hover: #0a4a50;
  --color-primary-light: #e8f4f5;
  --color-secondary: #1a365d;
  --color-secondary-light: #ebf2f7;
  --color-neutral-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-accent: #c45c2a;
  --color-accent-hover: #a34a22;
  --color-accent-light: #fdf0e9;
  --color-text: #1a1a2e;
  --color-text-muted: #4a5568;
  --color-border: #e2e8f0;
  --color-border-focus: var(--color-primary);

  /* Typography */
  --font-heading: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --line-tight: 1.25;
  --line-normal: 1.5;
  --line-relaxed: 1.625;

  /* Spacing — 8px grid */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-soft: 0 4px 14px rgba(13, 92, 99, 0.08);

  /* Layout */
  --container-max: 1120px;
  --header-height: 64px;
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  color: var(--color-text);
  background-color: var(--color-neutral-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
@media (min-width: 640px) {
  .container { padding-left: var(--space-6); padding-right: var(--space-6); }
}
@media (min-width: 1024px) {
  .container { padding-left: var(--space-8); padding-right: var(--space-8); }
}

.section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.section--tight { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.section--hero { padding-top: var(--space-16); padding-bottom: var(--space-16); }
@media (min-width: 768px) {
  .section--hero { padding-top: var(--space-20); padding-bottom: var(--space-20); }
}

.section-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
  border: 0;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.site-logo {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}
.site-logo:hover { text-decoration: none; color: var(--color-primary-hover); }
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.site-nav a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.site-nav a:hover { color: var(--color-primary); }
@media (max-width: 639px) {
  .site-nav { gap: var(--space-4); }
  .site-nav a { font-size: var(--text-xs); }
}

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  background: var(--color-surface);
}
.hero__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--line-tight);
  color: var(--color-text);
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .hero__title { font-size: var(--text-4xl); }
}
.hero__subtitle {
  margin: 0 0 var(--space-8);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--line-relaxed);
}

/* --------------------------------------------------------------------------
   CARDS (input form & result)
   -------------------------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
}
@media (min-width: 640px) {
  .card { padding: var(--space-8); }
}
.card--soft { box-shadow: var(--shadow-soft); }
.card__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.card__description {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--line-relaxed);
}

/* Form card */
.form-card .form-group {
  margin-bottom: var(--space-4);
}
.form-card label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.form-card input[type="text"],
.form-card input[type="search"],
.form-card select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-card input:focus,
.form-card select:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-card input::placeholder { color: var(--color-text-muted); }

/* Result card */
.result-card {
  margin-top: var(--space-6);
}
.result-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  margin: 0 0 var(--space-2);
}
.result-card__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.result-card__meaning {
  font-size: var(--text-base);
  line-height: var(--line-relaxed);
  color: var(--color-text);
}
.result-card__list {
  margin: var(--space-4) 0 0;
  padding-left: var(--space-6);
}
.result-card__list li { margin-bottom: var(--space-2); }

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.btn:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  text-decoration: none;
}
.btn--accent {
  background: var(--color-accent);
  color: #fff;
}
.btn--accent:hover:not(:disabled) {
  background: var(--color-accent-hover);
  text-decoration: none;
}
.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   FAQ ACCORDION
   -------------------------------------------------------------------------- */
.faq-list { list-style: none; margin: 0; padding: 0; }
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-item:last-child { margin-bottom: 0; }
.faq-item[data-open="true"] .faq-item__panel { display: block; }
.faq-item[data-open="true"] .faq-item__trigger .faq-item__icon { transform: rotate(180deg); }
.faq-item__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}
.faq-item__trigger:hover { background: var(--color-neutral-bg); }
.faq-item__trigger:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: -2px; }
.faq-item__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
  color: var(--color-text-muted);
}
.faq-item__panel {
  display: none;
  padding: 0 var(--space-5) var(--space-4);
}
.faq-item__content {
  margin: 0;
  padding-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--line-relaxed);
  border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-secondary);
  color: rgba(255, 255, 255, 0.9);
  padding-top: var(--space-12);
  padding-bottom: var(--space-8);
  margin-top: var(--space-16);
}
.site-footer a { color: rgba(255, 255, 255, 0.95); }
.site-footer a:hover { text-decoration: underline; }
.footer-grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer__heading {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}
.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer__links li { margin-bottom: var(--space-2); }
.footer__bottom {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}
.footer__bottom a { color: rgba(255, 255, 255, 0.9); }

/* --------------------------------------------------------------------------
   UTILITIES
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* Breadcrumb (programmatic pages) */
.breadcrumb {
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.breadcrumb a { color: var(--color-primary); }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: var(--weight-medium); }

/* Section heading */
.section-heading {
  margin: 0 0 var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  text-align: center;
}
@media (min-width: 768px) {
  .section-heading { font-size: var(--text-3xl); }
}
