/* ============================================
   Cypher 2 — page styles
   Inherits tokens from style.css
   ============================================ */

.cypher-body {
  min-height: 100vh;
}

.cypher-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 8vw;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cypher-back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s var(--duration), background 0.3s var(--duration);
}

.cypher-back:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}

.cypher-back-arrow {
  display: inline-block;
  transition: transform 0.3s var(--duration);
}

.cypher-back:hover .cypher-back-arrow {
  transform: translateX(-3px);
}

.cypher-nav-meta {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cypher-main {
  position: relative;
  z-index: 5;
  max-width: 1240px;
  margin: 0 auto;
  padding: 120px 8vw 80px;
}

/* ============================================
   Cypher hero
   ============================================ */

.cypher-hero {
  max-width: 720px;
  margin-bottom: 80px;
}

.cypher-eyebrow {
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: block;
}

.cypher-title {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(56px, 9vw, 104px);
  line-height: 0.95;
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  margin-bottom: 28px;
  background: linear-gradient(180deg, #FFFFFF 0%, #C0C0CA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cypher-lede {
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--ink-mute);
  font-weight: 400;
  max-width: 560px;
}

/* ============================================
   Lab
   ============================================ */

.cypher-lab {
  margin-bottom: 120px;
}

.cypher-grid {
  display: grid;
  grid-template-columns: 1fr 220px 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.cypher-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
  transition: border-color 0.4s var(--duration), background 0.4s var(--duration);
  min-height: 360px;
}

.cypher-panel:focus-within {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}

.cypher-panel.updated {
  border-color: rgba(110, 139, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(110, 139, 255, 0.25), 0 12px 40px -20px rgba(110, 139, 255, 0.4);
}

.cypher-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.cypher-label {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cypher-badge {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-mute);
}

.cypher-area {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  padding: 22px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  letter-spacing: 0.01em;
  min-height: 240px;
}

.cypher-area::placeholder {
  color: var(--ink-faint);
}

.cypher-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* ============================================
   Controls (center column)
   ============================================ */

.cypher-controls {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cypher-shift {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
}

.cypher-shift-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cypher-shift-row input[type="number"] {
  width: 64px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  -moz-appearance: textfield;
}

.cypher-shift-row input[type="number"]::-webkit-outer-spin-button,
.cypher-shift-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cypher-shift-row input[type="number"]:focus {
  outline: 0;
  border-color: var(--line-strong);
}

.cypher-step {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-mute);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.25s var(--duration), color 0.25s var(--duration), background 0.25s var(--duration);
}

.cypher-step:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.cypher-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  margin: 4px 0;
}

.cypher-slider::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}

.cypher-slider::-moz-range-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}

.cypher-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  margin-top: -6px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.25s var(--duration);
}

.cypher-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.cypher-slider:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(110, 139, 255, 0.18);
}

.cypher-alphabet {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 1px;
  width: 100%;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.cypher-alphabet .glyph {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: color 0.25s var(--duration), border-color 0.25s var(--duration), background 0.25s var(--duration);
  position: relative;
}

.cypher-alphabet .glyph.from {
  color: var(--ink-mute);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.cypher-alphabet .glyph.to {
  color: #B6C5FF;
  border-color: rgba(110, 139, 255, 0.4);
  background: rgba(110, 139, 255, 0.08);
}

.cypher-alphabet .glyph .arrow {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -2px);
  font-size: 8px;
  color: var(--accent);
  opacity: 0;
}

.cypher-alphabet .glyph.to .arrow {
  opacity: 0.8;
}

/* ============================================
   Meta line
   ============================================ */

.cypher-meta-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cypher-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
}

/* ============================================
   Notes
   ============================================ */

.cypher-notes {
  max-width: 720px;
  border-top: 1px solid var(--line);
  padding-top: 48px;
}

.cypher-notes-title {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
  margin-bottom: 24px;
}

.cypher-notes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cypher-notes li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-mute);
  padding-left: 18px;
  position: relative;
}

.cypher-notes li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-faint);
}

.cypher-notes em {
  color: var(--ink);
  font-style: italic;
  font-family: var(--serif);
}

/* ============================================
   Reveal
   ============================================ */

.cypher-hero, .cypher-lab, .cypher-notes {
  opacity: 0;
  transform: translateY(20px);
  animation: cypherRise 1.1s var(--duration) 0.15s forwards;
}

.cypher-lab { animation-delay: 0.3s; }
.cypher-notes { animation-delay: 0.45s; }

@keyframes cypherRise {
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 980px) {
  .cypher-grid {
    grid-template-columns: 1fr;
  }
  .cypher-controls {
    order: -1;
  }
  .cypher-shift {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
  }
  .cypher-alphabet {
    grid-template-columns: repeat(13, 1fr);
  }
}

@media (max-width: 760px) {
  .cypher-main { padding: 80px 6vw 60px; }
  .cypher-nav { padding: 18px 6vw; }
  .cypher-area { min-height: 180px; padding: 18px; font-size: 14px; }
  .cypher-panel { min-height: 0; }
  .cypher-alphabet { grid-template-columns: repeat(13, 1fr); font-size: 9px; }
  .cypher-title { font-size: clamp(48px, 14vw, 84px); }
  .cypher-hero { margin-bottom: 56px; }
  .cypher-lab { margin-bottom: 80px; }
}

/* ============================================
   Android phones
   ============================================ */

@media (max-width: 520px) {
  .cypher-main {
    padding: 90px 5vw 50px;
    min-height: 100svh;
    min-height: 100dvh;
  }
  .cypher-nav {
    padding: 14px 5vw;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cypher-back {
    font-size: 13px;
    padding: 7px 12px 7px 9px;
  }
  .cypher-nav-meta {
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .cypher-hero { margin-bottom: 40px; }
  .cypher-title { font-size: clamp(40px, 15vw, 64px); }
  .cypher-lede { font-size: 15px; line-height: 1.55; }
  .cypher-eyebrow { font-size: 10px; margin-bottom: 18px; }

  .cypher-lab { margin-bottom: 64px; }
  .cypher-grid { gap: 14px; margin-bottom: 32px; }
  .cypher-panel { border-radius: 14px; min-height: 0; }
  .cypher-panel-head { padding: 14px 18px; }
  .cypher-label { font-size: 10px; letter-spacing: 0.14em; }
  .cypher-badge { font-size: 9px; padding: 3px 7px; }
  .cypher-area {
    min-height: 140px;
    padding: 16px 18px;
    font-size: 13.5px;
    line-height: 1.55;
  }
  .cypher-foot { padding: 12px 18px; font-size: 10px; }

  /* controls inline on phone */
  .cypher-shift {
    padding: 18px 14px;
    gap: 12px;
    border-radius: 14px;
  }
  .cypher-shift-row input[type="number"] {
    width: 56px;
    font-size: 15px;
    padding: 9px 6px;
  }
  .cypher-step {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .cypher-slider {
    width: 100%;
  }
  .cypher-alphabet {
    grid-template-columns: repeat(13, 1fr);
    gap: 2px;
    font-size: 8px;
  }
  .cypher-alphabet .glyph {
    border-radius: 3px;
  }
  .cypher-meta-line {
    font-size: 9.5px;
    letter-spacing: 0.1em;
    gap: 8px;
  }

  .cypher-notes { padding-top: 36px; }
  .cypher-notes-title { font-size: 10px; margin-bottom: 18px; }
  .cypher-notes li { font-size: 14px; padding-left: 16px; }
}

/* ============================================
   Landscape phones
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .cypher-main { padding: 70px 5vw 40px; }
  .cypher-grid { grid-template-columns: 1fr 200px 1fr; }
  .cypher-area { min-height: 120px; }
  .cypher-hero { margin-bottom: 28px; }
  .cypher-title { font-size: clamp(36px, 6vw, 52px); }
  .cypher-lab { margin-bottom: 48px; }
}

/* ============================================
   Touch / tap states
   ============================================ */

@media (hover: none) {
  .cypher-step:active { background: rgba(255, 255, 255, 0.06); border-color: var(--line-strong); color: var(--ink); }
  .cypher-back:active { background: rgba(255, 255, 255, 0.04); }
  .cypher-area { -webkit-tap-highlight-color: transparent; }
}
