/* ============================================================
   COGITATOR — BASE STYLES
   base.css — Reset, typography defaults, global rules.
   Import after variables.css.
   ============================================================ */

/* ----------------------------------------------------------
   BOX MODEL RESET
   ---------------------------------------------------------- */

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

/* ----------------------------------------------------------
   ROOT + BODY
   ---------------------------------------------------------- */

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

body {
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#app {
  height: 100%;
  min-height: 100%;
}

/* ----------------------------------------------------------
   TYPOGRAPHY
   ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  letter-spacing: var(--heading-tracking);
  color: var(--text-hi);
  line-height: 1.05;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  line-height: 1.6;
}

strong {
  font-weight: 600;
  color: var(--text-hi);
}

small {
  font-size: var(--text-sm);
  color: var(--text-dim);
}

/* ----------------------------------------------------------
   LINKS
   ---------------------------------------------------------- */

a {
  color: var(--amber);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--amber-dim);
  text-decoration: underline;
}

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

/* ----------------------------------------------------------
   LISTS
   ---------------------------------------------------------- */

ul, ol {
  list-style: none;
}

/* ----------------------------------------------------------
   FORM ELEMENTS — GLOBAL RESETS
   ---------------------------------------------------------- */

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea,
select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

/* ----------------------------------------------------------
   IMAGES
   ---------------------------------------------------------- */

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

/* ----------------------------------------------------------
   SCROLLBAR — WEBKIT
   ---------------------------------------------------------- */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hi);
}

/* ----------------------------------------------------------
   SELECTION
   ---------------------------------------------------------- */

::selection {
  background: var(--amber-glow);
  color: var(--text-hi);
}

/* ----------------------------------------------------------
   UTILITY — VISUALLY HIDDEN (a11y)
   ---------------------------------------------------------- */

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

/* ----------------------------------------------------------
   UTILITY — LOADING SPINNER
   ---------------------------------------------------------- */

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

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ----------------------------------------------------------
   PORTRAIT ORIENTATION PROMPT
   ---------------------------------------------------------- */

.portrait-prompt {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--bg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--heading-tracking);
  color: var(--text-dim);
  text-align: center;
  padding: var(--space-8);
}

@media (orientation: portrait) {
  .portrait-prompt {
    display: flex;
  }
}
