/* Base styles and reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--ink);
  color: var(--paper-bg);
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

.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;
}

/* Focus indicators */
*:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

/* Links */
a {
  color: var(--ink);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

/* Form elements */
input[type="text"] {
  font-family: inherit;
  font-size: inherit;
  border: none;
  border-bottom: 1px solid var(--line-blue);
  background: transparent;
  padding: 4px 0;
  color: var(--ink);
}

input[type="text"]:focus {
  border-bottom-color: var(--accent);
  outline: none;
}

input[type="radio"] {
  margin-right: 8px;
  accent-color: var(--success);
}

/* Select elements */
select {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid var(--line-blue);
  background: var(--paper-bg);
  padding: 4px 8px;
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

select:focus {
  border-color: var(--accent);
  outline: none;
}

select:hover {
  border-color: var(--accent);
}

.coin-selector {
  display: inline-block;
  margin: 0 8px;
  min-width: 150px;
}

/* Choice links */
.choice-link {
  color: var(--ink);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.choice-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.choice-link:visited {
  color: var(--ink);
}

/* Typography */
h1, h2, h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin-bottom: 1rem;
}

small {
  font-size: 0.875rem;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mt-1 {
  margin-top: 1rem;
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Header buy link with red pen circle */
.header-buy-link {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-weight: bold;
  padding: 8px 12px;
  display: inline-block;
}

.header-buy-link::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -12px;
  right: -12px;
  bottom: -8px;
  border: 3px solid #dc2626;
  border-radius: 50%;
  transform: rotate(-3deg);
  z-index: 1;
  pointer-events: none;
}

.header-buy-link:hover {
  color: var(--accent);
}

/* Print styles */
@media print {
  .panic-button,
  .mode-toggle {
    display: none !important;
  }
  
  .paper-container {
    box-shadow: none !important;
  }
}
