/* ============================================================
   TIZMEK — Coming soon (home page).
   Fonts and design tokens live in tokens.css, which every page loads first.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background .45s ease, color .45s ease;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, var(--glow) 0%, transparent 60%);
  pointer-events: none;
  transition: background .45s ease;
  z-index: 0;
}

/* ---- Controls ---- */
.controls {
  position: fixed;
  top: 22px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 5;
}
.seg {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field-bg);
  backdrop-filter: blur(6px);
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 6px 11px;
  border-radius: 999px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s ease, background .2s ease;
}
.seg button:hover { color: var(--fg); }
.seg button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.seg button[aria-pressed="true"] {
  background: var(--terra);
  color: var(--warm-paper);
}
#themeSeg button { padding: 6px 9px; }
.swatch {
  width: 15px; height: 15px; border-radius: 50%;
  display: block; border: 1.5px solid currentColor;
}
.swatch.light { background: #FBF8F1; color: #C9A96B; }
.swatch.dark { background: #171009; color: #8A6B4A; }
#themeSeg button[aria-pressed="true"] .swatch {
  box-shadow: 0 0 0 2px var(--terra), 0 0 0 3.5px var(--amber);
  border-color: var(--warm-paper);
}

/* ---- Main ---- */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px 40px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 44px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); }
  70% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Horizontal lockup — the drawn logo: tile + wordmark (assets/img/).
   The tile is one file (its terracotta plate is the same in both themes);
   the wordmark ships in two colours because an external SVG in a background
   can't inherit the page's currentColor. */
.lockup {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 40px;
}
.tile {
  width: 100px;
  height: 100px;
  flex: 0 0 auto;
  filter: drop-shadow(0 24px 48px rgba(194, 65, 12, .45));
}
.wm {
  display: block;
  height: 46px;
  aspect-ratio: 606.41 / 135.52;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url('../assets/img/tizmek-wordmark-ink.svg');
}
html[data-theme="dark"] .wm {
  background-image: url('../assets/img/tizmek-wordmark-paper.svg');
}

h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(56px, 11vw, 120px);
  letter-spacing: -.055em;
  line-height: .92;
  margin: 0 0 18px;
  color: var(--fg);
}
.sub {
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 44ch;
  margin: 0 0 40px;
  font-weight: 500;
}

/* ---- Loading indicator (under the logo) ---- */
.loader {
  position: relative;
  width: min(240px, 62vw);
  height: 6px;
  margin: 4px 0 0;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}
.loader-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--terra), var(--amber));
  box-shadow: 0 0 12px -2px var(--amber);
  animation: loaderSlide 1.5s cubic-bezier(.65, .05, .36, 1) infinite;
  will-change: transform;
}
@keyframes loaderSlide {
  0%   { transform: translateX(-115%); }
  100% { transform: translateX(240%); }
}
@media (prefers-reduced-motion: reduce) {
  .loader-bar {
    animation: none;
    width: 100%;
    opacity: .55;
  }
}

/* ---- Notify form ---- */
.form-wrap { width: 100%; max-width: 440px; display: flex; justify-content: center; }
.notify {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  padding: 5px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: var(--field-bg);
  transition: border-color .2s ease, background .45s ease;
}
.notify:focus-within { border-color: var(--amber); }
.notify input {
  flex: 1;
  min-width: 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--field-fg);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 0 14px 0 18px;
  outline: none;
}
.notify input::placeholder { color: var(--muted); }
.notify button {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  cursor: pointer;
  background: var(--terra);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -.01em;
  padding: 12px 22px;
  border-radius: 999px;
  transition: background .2s ease, transform .1s ease, opacity .2s ease;
}
.notify button:hover { background: var(--terra-deep); }
.notify button:active { transform: scale(.97); }
.notify button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.notify[aria-busy="true"] button { opacity: .6; cursor: progress; }

/* Honeypot — visually and programmatically hidden, still in the DOM for bots */
.hp {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Form status message */
.msg {
  display: none;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  min-height: 52px;
  text-align: left;
}
.msg.show { display: inline-flex; }
.msg.is-error { color: var(--err); }
.msg .check {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--amber);
  color: #171009;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex: 0 0 auto;
}
.msg.is-error .check { display: none; }

footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.foot-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.foot-links .sep { opacity: .45; }
.contact {
  color: var(--muted);
  text-decoration: none;
  text-transform: none;
  letter-spacing: .02em;
  transition: color .2s ease;
}
.contact:hover { color: var(--fg); }
.contact:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

/* ---- Entrance (visible is the base state; animate FROM hidden only under .preload) ---- */
.status, .lockup, h1, .sub, .loader, .form-wrap {
  opacity: 1;
  transform: none;
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}
html.preload .status,
html.preload .lockup,
html.preload h1,
html.preload .sub,
html.preload .loader,
html.preload .form-wrap {
  opacity: 0;
  transform: translateY(14px);
}
.lockup { transition-delay: .06s; }
h1 { transition-delay: .14s; }
.sub { transition-delay: .2s; }
.loader { transition-delay: .2s; }
.form-wrap { transition-delay: .26s; }

@media (prefers-reduced-motion: reduce) {
  .status, .lockup, h1, .sub, .form-wrap,
  body, body::before, .wm, .notify, .seg button, .notify button {
    transition: none !important;
    animation: none !important;
  }
  html.preload .status,
  html.preload .lockup,
  html.preload h1,
  html.preload .sub,
  html.preload .loader,
  html.preload .form-wrap {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 520px) {
  .lockup { gap: 16px; }
  .tile { width: 76px; height: 76px; }
  .wm { height: 35px; }
  .controls { top: 16px; right: 16px; }
  .notify { flex-direction: column; border-radius: 20px; padding: 8px; }
  .notify input { padding: 12px 14px; text-align: center; }
  .notify button { width: 100%; padding: 13px; }
}
