/* ==========================================================================
   THEME — design tokens
   Neutral gray background, single steel-blue accent, one grotesk
   family for display + body so the whole site reads as one voice.
   Change values here to re-skin the whole site.
   ========================================================================== */

:root {
  /* color */
  --bg:          #F5F5F6;
  --bg-alt:      #ECEDEF;
  --surface:     #FFFFFF;
  --ink:         #202225;
  --ink-soft:    #5A5E64;
  --ink-faint:   #8D9198;
  --border:      #E1E2E5;
  --accent:      #3B6EA5;   /* steel blue — links, primary actions */
  --accent-dim:  #2E578A;
  --accent-ink:  #FFFFFF;
  --accent-warm: #6B7280;   /* neutral slate — secondary highlight, hover pop */
  --accent-soft: rgba(59, 110, 165, 0.09);

  /* type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* layout */
  --wrap: 1080px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(20, 21, 23, 0.04), 0 8px 24px rgba(20, 21, 23, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 21, 23, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #17181A;
    --bg-alt:      #1E1F22;
    --surface:     #212327;
    --ink:         #ECEDEE;
    --ink-soft:    #A7ABB1;
    --ink-faint:   #6D7178;
    --border:      #2C2E32;
    --accent:      #7BA6D9;
    --accent-dim:  #5C89BE;
    --accent-ink:  #10181F;
    --accent-warm: #9CA3AF;
    --accent-soft: rgba(123, 166, 217, 0.12);
    --shadow:    0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.3rem, 4.2vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

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

.wrap {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 68px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  transition: opacity 0.15s ease;
}

.mark:hover { opacity: 0.8; }

.mark-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  box-shadow: 0 3px 10px var(--accent-soft);
}

.site-nav ul {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: right 0.2s ease;
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }

.site-nav a.active {
  color: var(--ink);
  font-weight: 500;
}
.site-nav a.active::after { right: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Main content
   ========================================================================== */

.site-main {
  flex: 1;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero {
  position: relative;
  max-width: 700px;
  margin-bottom: clamp(2.75rem, 5vw, 4.5rem);
}

.hero .eyebrow { margin-bottom: 1.1rem; }

.hero h1 { margin-bottom: 0.6em; }

.hero .lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 54ch;
}

.hero .tag-list { margin-bottom: 1.5rem; }

/* Card grid — used for linking out to different sections/apps of the site */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 1.4rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card-icon {
  transform: scale(1.08) rotate(-4deg);
}

.card h2 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  line-height: 1.55;
}

.card:hover h2 {
  color: var(--accent);
}

.card-tag {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  transition: color 0.15s ease, transform 0.15s ease;
}

.back-link:hover { color: var(--accent); transform: translateX(-2px); }

/* Generic building blocks for extending pages */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.prose { max-width: 68ch; }
.prose p { color: var(--ink-soft); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.message-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.message {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.message-error {
  border-color: #c66;
  background: color-mix(in srgb, #d9534f 8%, var(--surface));
  color: #a33;
}

.message-success {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dim);
}

.section-heading {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.section-heading:first-child { margin-top: 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

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

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.footer-inner p { margin: 0; color: var(--ink-faint); }

.to-top { color: var(--ink-faint); transition: color 0.15s ease; }
.to-top:hover { color: var(--accent); }

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

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.open { max-height: 320px; }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
  }

  .site-nav a {
    display: block;
    padding: 0.7rem 0;
  }

  .site-nav a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Tool pages — shared form styling (QR generator, CueFlow, etc.)
   ========================================================================== */

.converter-container {
  max-width: 600px;
  margin-bottom: 3rem;
}

.converter-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.75rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.form-group small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

input[type="text"], input[type="url"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus, input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="text"]::placeholder, input[type="url"]::placeholder {
  color: var(--ink-faint);
}

.format-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.radio-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.radio-label:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.radio-label input[type="radio"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.radio-label span {
  font-weight: 600;
  color: var(--ink);
  font-family: var(--font-display);
}

.radio-label small {
  color: var(--ink-faint);
  font-size: 0.8rem;
  margin: 0;
}

input[type="radio"]:checked + span {
  color: var(--accent);
  font-weight: 700;
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.alert-error {
  background: color-mix(in srgb, #d9534f 8%, var(--surface));
  border-color: #e0a3a3;
  color: #a33;
}

.alert-error strong { color: #822; }

.alert-success {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dim);
}

.alert-success strong { color: var(--accent-dim); }

.alert p {
  margin: 0.4rem 0;
  color: inherit;
  font-size: 0.95rem;
}

.alert p:first-child {
  margin-top: 0;
}

.download-result {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--accent-ink);
  padding: 1.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.download-result h3 {
  margin: 0 0 1rem;
  color: var(--accent-ink);
  font-size: 1.25rem;
}

.download-result p {
  margin: 0.5rem 0;
  color: var(--accent-ink);
}

.file-size {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  opacity: 0.95;
}

.btn-download {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.8rem 1.5rem;
  background: var(--accent-ink);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.info-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.info-section h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.info-section h2:first-child {
  margin-top: 0;
}

.info-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.info-section li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
  color: var(--ink-soft);
}

.info-section li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.info-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  color: var(--ink);
}

.info-section p {
  color: var(--ink-soft);
  line-height: 1.7;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .converter-form {
    padding: 1.5rem;
  }

  .format-options {
    grid-template-columns: 1fr;
  }

  .radio-label {
    padding: 0.85rem;
  }
}
