/* ============================================================
   IT MANAGEMENT WORKSHOP 2026 — Timeglass
   Premium Corporate × Modern Technology × Cinematic Minimalism
   ============================================================ */

:root {
  --bg-0: #04070d;
  --bg-1: #0a1220;
  --bg-2: #101b2e;
  --gold: #e8b64c;
  --gold-bright: #ffd98a;
  --gold-deep: #b9822a;
  --ink: #f2ead8;
  --ink-dim: #a9b2c3;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-line: rgba(255, 255, 255, 0.18);
  --danger: #ff8a7a;
  --font-sans: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: radial-gradient(120% 120% at 50% 35%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  -webkit-font-smoothing: antialiased;
}

/* Full-viewport stage */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3vh 4vw 2vh;
  overflow: hidden;
}

/* Ambient glow behind hourglass */
.glow {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 62vmin;
  height: 62vmin;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(232, 182, 76, 0.16) 0%, rgba(232, 182, 76, 0.05) 42%, transparent 68%);
  filter: blur(6px);
  border-radius: 50%;
  pointer-events: none;
  animation: glow-breathe 7s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.05); }
}

/* Floating ambient dust particles */
.dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.dust i {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--gold-bright);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 6px 1px rgba(255, 217, 138, 0.5);
  animation: dust-float linear infinite;
}
@keyframes dust-float {
  0%   { transform: translateY(10vh); opacity: 0; }
  15%  { opacity: var(--o, 0.4); }
  85%  { opacity: var(--o, 0.4); }
  100% { transform: translateY(-110vh); opacity: 0; }
}

/* ---------------- Header ---------------- */
.header {
  text-align: center;
  z-index: 2;
  margin-bottom: 1vh;
}
.title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.2vmin, 66px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  line-height: 1.08;
}
.title span {
  color: var(--gold);
}
.tagline {
  margin-top: 1.2vh;
  font-size: clamp(13px, 1.7vmin, 22px);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--ink-dim);
  text-transform: uppercase;
  font-weight: 300;
}

/* ---------------- Main / clock ---------------- */
.main {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
}
.clock {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(60px, 13vmin, 190px);
  letter-spacing: 0.06em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.55), 0 0 60px rgba(232, 182, 76, 0.12);
  z-index: 2;
}
.clock.low {
  color: #ffd9c9;
  text-shadow: 0 4px 40px rgba(0,0,0,0.5), 0 0 70px rgba(255, 138, 122, 0.28);
}
.clock.up {
  color: var(--danger);
  text-shadow: 0 4px 44px rgba(0,0,0,0.5), 0 0 90px rgba(255, 138, 122, 0.4);
}
.status {
  margin-top: 1vh;
  font-size: clamp(12px, 1.6vmin, 20px);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--ink-dim);
  text-transform: uppercase;
  min-height: 1.6em;
  z-index: 2;
  font-weight: 300;
}
.status.up {
  color: var(--danger);
  font-weight: 600;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  animation: status-pulse 2.2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 1; }
}

/* ---------------- Hourglass ---------------- */
.hourglass-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.hourglass {
  width: 100%;
  height: 100%;
  max-height: 58vh;
  display: block;
}

/* ---------------- Controls ---------------- */
.controls {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4vh;
  padding-top: 1vh;
}
.config {
  display: flex;
  gap: 1vw;
}
.cfg {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  padding: 0.5em 0.9em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cfg-label {
  font-size: 0.72em;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
}
.cfg-input {
  width: 3.2em;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 1.1em;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.cfg-input::-webkit-outer-spin-button,
.cfg-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.buttons {
  display: flex;
  gap: 0.8vw;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  min-width: 128px;
  padding: 0.85em 1.6em;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  color: var(--ink);
  font-size: 0.82em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.22s ease;
}
.btn:hover { background: rgba(255,255,255,0.1); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, rgba(232,182,76,0.28), rgba(232,182,76,0.12));
  border-color: rgba(232,182,76,0.5);
  color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(232,182,76,0.15);
}
.btn-primary:hover { background: linear-gradient(135deg, rgba(232,182,76,0.4), rgba(232,182,76,0.2)); }

.hint {
  font-size: 0.66em;
  letter-spacing: 0.24em;
  color: var(--ink-dim);
  opacity: 0.7;
}

/* ---------------- Fullscreen workshop mode ---------------- */
body.fs .controls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
body.fs .stage:hover .controls,
body.fs .controls:hover {
  opacity: 1;
  pointer-events: auto;
}

/* ---------------- Responsive ---------------- */
@media (max-aspect-ratio: 4/5) {
  /* portrait / mobile */
  .title { font-size: clamp(20px, 5.4vmin, 40px); letter-spacing: 0.1em; }
  .clock { font-size: clamp(46px, 17vmin, 110px); }
  .hourglass { max-height: 40vh; }
  .btn { min-width: 96px; padding: 0.7em 1.1em; }
}

@media (prefers-reduced-motion: reduce) {
  .glow, .dust i, .status.up { animation: none !important; }
}
