/* SciDev — Coming Soon
   Sleek dark-mode, bilingual (RTL/LTR), glassmorphism terminal UI. */

:root {
  --bg-abyss: #060d1a;
  --bg-navy: #0a1a2f;
  --surface: rgba(13, 27, 42, 0.55);
  --surface-strong: rgba(11, 22, 37, 0.82);
  --glass-border: rgba(120, 180, 220, 0.18);

  --accent-cyan: #22d3ee;
  --accent-bright: #00e5ff;
  --accent-deep: #0e7490;

  --text: #e8eef5;
  --text-muted: #a0b4c9;
  --text-dim: #8398b1;

  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: "Vazirmatn", "Segoe UI", system-ui, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-deep: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(14, 116, 144, 0.20), transparent 60%),
    radial-gradient(900px 600px at 85% 110%, rgba(34, 211, 238, 0.12), transparent 55%),
    var(--bg-abyss);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient background layers -------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("backg.jpg") center / cover no-repeat;
  opacity: 0.16;
  filter: saturate(1.1) contrast(1.05);
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 13, 26, 0.72), rgba(6, 13, 26, 0.92)),
    radial-gradient(circle at 50% 40%, transparent 30%, rgba(6, 13, 26, 0.85) 100%);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
}

/* Boot panel ----------------------------------------------------------------- */
.boot {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

.boot__panel {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.4rem, 3.5vw, 2rem);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 60px -30px rgba(34, 211, 238, 0.25);
}

.boot__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.55), transparent 40%, transparent 70%, rgba(34, 211, 238, 0.28));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* Brand ---------------------------------------------------------------------- */
.brand {
  display: grid;
  place-items: center;
}

.brand__medallion {
  display: grid;
  place-items: center;
}

/* The artwork is transparent and already carries its own glow — just a soft
   neutral shadow for depth, no coloured halo. */
.brand__logo {
  inline-size: clamp(200px, 56vw, 264px);
  block-size: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.45));
}

/* Terminal ------------------------------------------------------------------- */
.terminal {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 45px -28px rgba(0, 0, 0, 0.8);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  border-bottom: 1px solid rgba(120, 180, 220, 0.12);
}

.terminal__dots {
  display: inline-flex;
  gap: 0.4rem;
}

.terminal__dot {
  inline-size: 0.72rem;
  block-size: 0.72rem;
  border-radius: 50%;
  background: #33465c;
}

.terminal__dot--red { background: #ff5f57; }
.terminal__dot--amber { background: #febc2e; }
.terminal__dot--green { background: #28c840; }

.terminal__title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.terminal__body {
  padding: clamp(1.1rem, 3.5vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Headline (typewriter) ------------------------------------------------------ */
.headline {
  direction: ltr;
  text-align: left;
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5ch;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(0.98rem, 3.6vw, 1.4rem);
  line-height: 1.4;
  color: var(--text);
}

.headline__prompt {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
}

.headline__text {
  background: linear-gradient(90deg, #ffffff, #a9e9f5);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.headline__caret {
  display: inline-block;
  inline-size: 0.62ch;
  block-size: 1.05em;
  transform: translateY(0.16em);
  background: var(--accent-bright);
  box-shadow: var(--glow-cyan);
  animation: caret-blink 1.05s steps(1) infinite;
}

/* Persian subhead ------------------------------------------------------------ */
.subhead {
  margin: 0;
  font-size: clamp(0.92rem, 3vw, 1.05rem);
  line-height: 2;
  color: var(--text-muted);
  text-align: start;
}

/* Progress / boot log -------------------------------------------------------- */
.progress {
  direction: ltr;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.progress__log {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 3.4em;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.progress__log-line {
  display: flex;
  gap: 0.6ch;
  opacity: 0;
  transform: translateY(4px);
  animation: log-in 0.35s var(--ease-out) forwards;
}

.progress__badge {
  color: var(--ok);
}

.progress__badge--work { color: var(--accent-cyan); }

.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.progress__stage {
  color: var(--text-muted);
}

.progress__value {
  color: var(--accent-cyan);
  font-weight: 700;
}

.progress__track {
  position: relative;
  block-size: 8px;
  border-radius: 999px;
  background: rgba(120, 180, 220, 0.12);
  overflow: hidden;
}

.progress__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-cyan), var(--accent-bright));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.7);
  transition: inline-size 0.2s linear;
}

.progress__fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: sheen 1.8s ease-in-out infinite;
}

/* Subscribe ------------------------------------------------------------------ */
.subscribe {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.subscribe__label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: start;
}

.subscribe__control {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.subscribe__control:focus-within {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.subscribe__control--error {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
  animation: shake 0.4s var(--ease-out);
}

.subscribe__input {
  flex: 1;
  min-width: 0;
  padding-inline: 1rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
}

.subscribe__input::placeholder {
  color: var(--text-dim);
}

.subscribe__button {
  flex-shrink: 0;
  padding: 0.7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: #04141b;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-cyan));
  box-shadow: 0 8px 24px -8px rgba(34, 211, 238, 0.7);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, filter 0.2s;
}

.subscribe__button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 30px -8px rgba(34, 211, 238, 0.85);
}

.subscribe__button:active {
  transform: translateY(0);
}

.subscribe__button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.35), 0 8px 24px -8px rgba(34, 211, 238, 0.7);
}

.subscribe__button-label {
  letter-spacing: 0.02em;
}

.subscribe__feedback {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.82rem;
  text-align: start;
  color: var(--text-muted);
}

.subscribe__feedback--ok { color: var(--ok); }
.subscribe__feedback--error { color: var(--danger); }

/* Social --------------------------------------------------------------------- */
.social {
  display: flex;
  gap: 0.85rem;
}

.social__link {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 12px;
  color: var(--text-muted);
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s, background 0.25s;
  will-change: transform;
}

.social__link:hover {
  color: var(--accent-bright);
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 8px 26px -10px rgba(34, 211, 238, 0.7);
}

.social__link:focus-visible {
  outline: none;
  color: var(--accent-bright);
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.3);
}

.social__icon {
  display: block;
  pointer-events: none;
}

/* Footer --------------------------------------------------------------------- */
.boot__footer {
  text-align: center;
}

.boot__copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

/* Toast ---------------------------------------------------------------------- */
.toast {
  position: fixed;
  inset-block-end: clamp(1rem, 4vw, 2rem);
  inset-inline-start: 50%;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid rgba(52, 211, 153, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0;
  transition: transform 0.45s var(--ease-out), opacity 0.45s;
  z-index: 10;
}

.toast--visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast__icon {
  display: grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  color: var(--ok);
  font-size: 0.75rem;
}

.toast__message {
  font-weight: 500;
}

/* Entrance state (JS on) ----------------------------------------------------- */
/* Hidden ahead of the scripted entrance; the delayed fail-safe animation
   guarantees content still appears if the script never runs. */
.js [data-animate] {
  opacity: 0;
  animation: failsafe-reveal 0.01s linear 3s forwards;
}

/* Keyframes ------------------------------------------------------------------ */
@keyframes halo-pulse {
  0%, 100% { opacity: 0.7; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes failsafe-reveal {
  to { opacity: 1; }
}

@keyframes caret-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes sheen {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

@keyframes log-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* Responsive ----------------------------------------------------------------- */
@media (max-width: 480px) {
  .subscribe__control {
    flex-direction: column;
    border-radius: var(--radius-sm);
  }

  .subscribe__input {
    padding-block: 0.7rem;
    text-align: center;
  }

  .subscribe__button {
    width: 100%;
  }
}

/* Motion & contrast preferences ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-animate] {
    opacity: 1;
  }

  .brand__medallion::before,
  .progress__fill::after,
  .headline__caret {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
