/* ===== SZÖVEG TITKOSÍTÓ ===== */

:root {
  --bg:           #0f0d0a;
  --surface:      #1a1510;
  --surface2:     #231c13;
  --border:       rgba(251,146,60,0.10);
  --border-hover: rgba(251,146,60,0.25);
  --accent:       #FB923C;
  --accent-glow:  rgba(251,146,60,0.14);
  --text:         #f5ede4;
  --muted:        rgba(245,237,228,0.45);
  --success:      rgba(100,220,150,0.9);
  --danger:       rgba(245,100,100,0.9);
  --t:            0.2s;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── BACK BUTTON ── */
.back {
  position: fixed;
  top: 1.25rem;
  left: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t);
  letter-spacing: 0.02em;
}
.back:hover { color: var(--text); }
.back svg { opacity: 0.7; transition: opacity var(--t); }
.back:hover svg { opacity: 1; }
.back:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* ── HERO ── */
.hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 7rem 1.5rem 4rem;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 55%, rgba(251,146,60,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 85%, rgba(251,146,60,0.04) 0%, transparent 60%);
  pointer-events: none;
  animation: aurora 14s ease-in-out infinite alternate;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(251,146,60,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 0%, transparent 70%);
  pointer-events: none;
}

@keyframes aurora {
  0%   { opacity: 0.4; transform: scale(1)    rotate(0deg); }
  100% { opacity: 0.7; transform: scale(1.15) rotate(3deg); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(251,146,60,0.22);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  margin-bottom: 1.4rem;
  background: rgba(251,146,60,0.06);
  animation: fade-up 0.8s cubic-bezier(.16,1,.3,1) 0.3s both;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.65); }
}

.hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3.2rem, 10vw, 6.8rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.25rem;
  animation: fade-up 0.9s cubic-bezier(.16,1,.3,1) 0.45s both;
}

.hero h1 .line2 {
  font-style: italic;
  color: var(--accent);
}

.hero-subtitle {
  font-size: clamp(0.87rem, 2vw, 1rem);
  color: var(--muted);
  max-width: 420px;
  line-height: 1.75;
  animation: fade-up 0.9s cubic-bezier(.16,1,.3,1) 0.6s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MAIN / CONTAINER ── */
main { padding-bottom: 5rem; }

.container {
  max-width: 640px;
  margin-inline: auto;
  padding: 0 1.5rem;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 28px;
  margin-bottom: 12px;
  animation: fade-up 0.65s cubic-bezier(.16,1,.3,1) both;
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.35s; }

/* ── MODE SELECTOR ── */
.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  animation: fade-up 0.65s cubic-bezier(.16,1,.3,1) 0.05s both;
}

.mode-btn {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
  letter-spacing: 0.02em;
}

.mode-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0a00;
  font-weight: 600;
}

.mode-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── CAESAR SETTINGS ── */
.caesar-settings {
  padding: 20px 28px;
}

.caesar-settings.hidden { display: none; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.shift-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  min-width: 2.5ch;
  text-align: right;
}

/* ── RANGE SLIDER ── */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--accent) var(--pct, 8%),
    var(--surface2) var(--pct, 8%)
  );
  margin-bottom: 6px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2.5px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(251,146,60,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(251,146,60,0.2);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--bg);
  cursor: pointer;
}

.slider::-moz-range-progress {
  background: var(--accent);
  border-radius: 5px;
  height: 5px;
}

.slider-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 1px;
}

/* ── CONVERTER CARD ── */
.converter-card { padding: 22px 24px; }

/* ── DIRECTION TOGGLE ── */
.dir-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.dir-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}

.dir-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.dir-btn.active {
  background: var(--accent-glow);
  border-color: rgba(251,146,60,0.35);
  color: var(--accent);
}

.dir-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.dir-icon { font-style: normal; }

.dir-arrow {
  font-size: 1.1rem;
  color: var(--muted);
  flex-shrink: 0;
  user-select: none;
}

/* ── IO BLOCKS ── */
.io-block { margin-bottom: 4px; }

.io-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.io-header .field-label { margin-bottom: 0; }

.io-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 110px;
  transition: border-color var(--t);
  outline: none;
}

.io-textarea::placeholder { color: var(--muted); opacity: 0.6; }

.io-textarea:focus {
  border-color: rgba(251,146,60,0.35);
  outline: none;
}

.io-textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.io-output {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 110px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
  transition: border-color var(--t);
}

.output-placeholder {
  color: var(--muted);
  opacity: 0.5;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

/* ── DIVIDER ── */
.io-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-icon {
  font-size: 1rem;
  user-select: none;
}

/* ── UTILITY BUTTONS ── */
.clear-btn,
.copy-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
  letter-spacing: 0.03em;
}

.clear-btn:hover,
.copy-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.copy-btn.copied {
  border-color: rgba(100,220,150,0.3);
  color: var(--success);
  background: rgba(100,220,150,0.06);
}

.clear-btn:focus-visible,
.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── INFO SECTION ── */
.info-section h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 18px;
}

.info-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color var(--t);
}

.info-block:last-child { margin-bottom: 0; }

.info-block:hover { border-color: var(--border-hover); }

.info-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}

.info-block p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

/* ── FOOTER ── */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t);
}

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

/* ── RESPONSIVE ── */
@media (max-width: 540px) {
  .container { padding: 0 1rem; }
  .hero { padding: 6rem 1rem 3rem; min-height: 45vh; }
  .card { padding: 18px 16px; }
  .mode-selector { gap: 6px; }
  .mode-btn { font-size: 0.82rem; padding: 10px 10px; }
  .dir-row { flex-wrap: wrap; }
  .dir-btn { min-width: 120px; }
}
