/* ============================================
   getstatuscodes.com
   Built by White Whale Web
   ============================================ */

:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F2F1EC;
  --text: #1A1A1A;
  --text-muted: #595959;
  --text-faint: #8A8A8A;
  --border: #E5E5E0;
  --border-strong: #C9C9C2;

  --c-1xx: #6B6B6B;
  --c-1xx-bg: #EFEEEA;
  --c-2xx: #2D7A3E;
  --c-2xx-bg: #E8F2EA;
  --c-3xx: #1F5BA8;
  --c-3xx-bg: #E5EDF7;
  --c-4xx: #B86E0B;
  --c-4xx-bg: #F7ECDA;
  --c-5xx: #B72020;
  --c-5xx-bg: #F7E5E5;

  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;

  --radius: 4px;
  --radius-lg: 6px;

  --max-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --surface: #1C1C1A;
    --surface-alt: #232320;
    --text: #F0EFEA;
    --text-muted: #9E9E97;
    --text-faint: #6B6B65;
    --border: #2C2C29;
    --border-strong: #3D3D39;

    --c-1xx: #A8A8A0;
    --c-1xx-bg: #2A2A27;
    --c-2xx: #6FBC7F;
    --c-2xx-bg: #1F2D22;
    --c-3xx: #6FA3DF;
    --c-3xx-bg: #1A2535;
    --c-4xx: #E2A04A;
    --c-4xx-bg: #2E2517;
    --c-5xx: #E66B6B;
    --c-5xx-bg: #2E1818;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Header ============ */

header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  background: var(--bg);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius);
}

.logo-text {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}

nav.nav-links {
  display: flex;
  gap: 24px;
}

nav.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

nav.nav-links a:hover {
  color: var(--text);
}

/* ============ Main / Hero ============ */

main {
  padding: 56px 0 80px;
}

.hero {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.tagline {
  font-size: 17px;
  color: var(--text-muted);
}

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

.check-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.url-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}

.url-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.check-button {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 22px;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.05s;
  white-space: nowrap;
}

.check-button:hover:not(:disabled) {
  opacity: 0.85;
}

.check-button:active:not(:disabled) {
  transform: translateY(1px);
}

.check-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-hint {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 40px;
}

/* ============ Results ============ */

.results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin-bottom: 48px;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-display {
  text-align: center;
  margin-bottom: 28px;
}

.status-code {
  font-family: var(--font-mono);
  font-size: 96px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.status-code.cat-1xx { color: var(--c-1xx); }
.status-code.cat-2xx { color: var(--c-2xx); }
.status-code.cat-3xx { color: var(--c-3xx); }
.status-code.cat-4xx { color: var(--c-4xx); }
.status-code.cat-5xx { color: var(--c-5xx); }

.status-name {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.status-short {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.meta-card {
  background: var(--surface-alt);
  padding: 12px 14px;
  border-radius: var(--radius);
}

.meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.meta-value {
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-mono);
  word-break: break-all;
}

.redirect-chain {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: var(--radius);
}

.redirect-chain-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.redirect-step {
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 4px;
  word-break: break-all;
}

.redirect-step:last-child {
  margin-bottom: 0;
}

.redirect-step-code {
  display: inline-block;
  min-width: 36px;
  font-weight: 600;
  margin-right: 8px;
}

.results-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.results-footer a {
  color: var(--text);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error-message {
  text-align: center;
  padding: 32px 24px;
}

.error-icon {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 500;
  color: var(--c-5xx);
  margin-bottom: 12px;
}

.error-text {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
}

.error-detail {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============ Intro Section ============ */

.intro-section {
  margin-bottom: 48px;
}

.intro-section h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.intro-section p {
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* ============ Category Pills ============ */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 64px;
}

.category-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px 14px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s, transform 0.1s;
}

.category-pill:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.category-pill-code {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.category-pill-code.cat-1xx { color: var(--c-1xx); }
.category-pill-code.cat-2xx { color: var(--c-2xx); }
.category-pill-code.cat-3xx { color: var(--c-3xx); }
.category-pill-code.cat-4xx { color: var(--c-4xx); }
.category-pill-code.cat-5xx { color: var(--c-5xx); }

.category-pill-name {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ Reference Page ============ */

.reference-header {
  margin-bottom: 40px;
}

.reference-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.reference-header p {
  color: var(--text-muted);
  font-size: 16px;
}

.code-category {
  margin-bottom: 48px;
}

.code-category-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.code-category-title-name {
  color: var(--text);
}

.code-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.code-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
  transition: background-color 0.15s;
  align-items: baseline;
}

.code-item:hover {
  background: var(--surface-alt);
}

.code-item-code {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}

.code-item-code.cat-1xx { color: var(--c-1xx); }
.code-item-code.cat-2xx { color: var(--c-2xx); }
.code-item-code.cat-3xx { color: var(--c-3xx); }
.code-item-code.cat-4xx { color: var(--c-4xx); }
.code-item-code.cat-5xx { color: var(--c-5xx); }

.code-item-text {
  font-size: 15px;
}

.code-item-name {
  font-weight: 500;
}

.code-item-short {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============ Individual Code Page ============ */

.code-page-back {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.15s;
}

.code-page-back:hover {
  color: var(--text);
}

.code-page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.code-page-category-tag {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.code-page-category-tag.cat-1xx { background: var(--c-1xx-bg); color: var(--c-1xx); }
.code-page-category-tag.cat-2xx { background: var(--c-2xx-bg); color: var(--c-2xx); }
.code-page-category-tag.cat-3xx { background: var(--c-3xx-bg); color: var(--c-3xx); }
.code-page-category-tag.cat-4xx { background: var(--c-4xx-bg); color: var(--c-4xx); }
.code-page-category-tag.cat-5xx { background: var(--c-5xx-bg); color: var(--c-5xx); }

.code-page-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.code-page-number {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.code-page-number.cat-1xx { color: var(--c-1xx); }
.code-page-number.cat-2xx { color: var(--c-2xx); }
.code-page-number.cat-3xx { color: var(--c-3xx); }
.code-page-number.cat-4xx { color: var(--c-4xx); }
.code-page-number.cat-5xx { color: var(--c-5xx); }

.code-page-name {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.code-page-short {
  font-size: 17px;
  color: var(--text-muted);
  margin-top: 6px;
}

.code-page-section {
  margin-bottom: 32px;
}

.code-page-section h2 {
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.code-page-section p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 12px;
}

.code-page-section ul {
  list-style: none;
  padding: 0;
}

.code-page-section li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.code-page-section li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 4px;
  height: 4px;
  background: var(--text-faint);
  border-radius: 50%;
}

.code-page-cta {
  margin-top: 48px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.code-page-cta p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.code-page-cta a {
  display: inline-block;
  padding: 10px 18px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 15px;
}

.code-page-related {
  margin-top: 32px;
}

.code-page-related h2 {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.code-page-related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.code-page-related a {
  display: inline-block;
  padding: 6px 12px;
  background: var(--surface-alt);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: background-color 0.15s;
}

.code-page-related a:hover {
  background: var(--border);
}

/* ============ Footer ============ */

footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
}

footer p {
  color: var(--text-faint);
  font-size: 13px;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}

footer a:hover {
  color: var(--text);
}

/* ============ Loading ============ */

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--bg);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: -2px;
}

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

/* ============ Mobile ============ */

@media (max-width: 600px) {
  .container {
    padding: 0 18px;
  }

  main {
    padding: 36px 0 60px;
  }

  h1 {
    font-size: 26px;
  }

  .tagline {
    font-size: 15px;
  }

  .check-form {
    flex-direction: column;
  }

  .results {
    padding: 28px 20px;
  }

  .status-code {
    font-size: 76px;
  }

  .status-name {
    font-size: 19px;
  }

  .code-page-number {
    font-size: 48px;
  }

  .code-page-name {
    font-size: 22px;
  }

  .code-item {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }

  nav.nav-links {
    gap: 16px;
    font-size: 13px;
  }
}
