/* ============================================================
   The Life Calendar — self-hosted clone styles
   ============================================================ */

:root {
  --bg: #0f0f10;
  --surface: #1a1a1c;
  --surface-2: #232326;
  --border: #2a2a2e;
  --text: #f4f4f5;
  --muted: #9b9ba1;
  --accent: #f56b3f;
  --accent-soft: #f56b3f22;
  --warn-bg: #2a2418;
  --warn-fg: #e6b34b;
  --radius: 14px;
  --max-w: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

@font-face {
  font-family: 'Inter';
  font-weight: 400;
  src: url('/static/fonts/Inter-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-weight: 500;
  src: url('/static/fonts/Inter-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  src: url('/static/fonts/Inter-Bold.ttf') format('truetype');
}

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

.topbar {
  text-align: center;
  padding: 28px 16px 0;
}
.topbar__title {
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 64px 24px 80px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 20px;
}
.hero__subtitle {
  color: var(--muted);
  font-size: 18px;
  max-width: 540px;
  line-height: 1.55;
  margin: 0;
}

.cards {
  margin-top: 96px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.cards .card:nth-child(3) { grid-column: 1 / -1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-2px); border-color: #3a3a3e; }

.card__preview {
  width: 200px;
  aspect-ratio: 9/19.5;
  background: #0a0a0b;
  border-radius: 28px;
  overflow: hidden;
  border: 8px solid #232326;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.7);
  margin: 12px 0 28px;
}
.card__preview img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

.card h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 320px;
  margin: 0 0 24px;
}

.btn-install {
  background: var(--text);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: opacity .2s;
  font-family: inherit;
}
.btn-install:hover { opacity: .85; }

/* ===== modal ============================================ */
.modal-open { overflow: hidden; }
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px 24px;
}
.modal__close {
  position: absolute; top: 14px; right: 18px;
  background: transparent; border: none;
  font-size: 28px; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.modal__close:hover { color: var(--text); }

.step h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.step__subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 30px;
  line-height: 1.55;
}

.model-picker {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 260px;
  gap: 40px;
  align-items: center;
  margin-top: 24px;
}
.model-picker__controls label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 7px;
}
.model-picker__controls select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 12px;
  font: inherit;
}
.model-picker__controls select:focus { outline: none; border-color: var(--accent); }
.model-picker__meta {
  color: var(--muted);
  font-size: 13px;
  min-height: 20px;
  margin: 8px 0 22px;
}
.btn-primary {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: 600 14px/1 inherit;
  padding: 13px 16px;
  transition: filter .2s, transform .2s;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:focus-visible { outline: 2px solid white; outline-offset: 3px; }

.phone-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 440px;
  margin: 0;
}
.phone-preview figcaption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 13px;
  max-width: 240px;
  text-align: center;
}
.phone-frame {
  position: relative;
  flex: none;
  overflow: hidden;
  background: #050506;
  border: 7px solid #36363b;
  border-radius: 31px;
  box-shadow:
    0 0 0 1px #606068,
    0 26px 50px -24px rgba(0, 0, 0, .9),
    inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: width .25s ease, height .25s ease, border-radius .25s ease;
}
.phone-frame::before,
.phone-frame::after {
  content: '';
  position: absolute;
  z-index: 3;
  left: -10px;
  width: 3px;
  height: 38px;
  border-radius: 2px 0 0 2px;
  background: #6a6a70;
}
.phone-frame::before { top: 82px; }
.phone-frame::after { top: 132px; height: 58px; }
.phone-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phone-frame__sensor {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  background: #050506;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04);
}
.phone-frame--notch .phone-frame__sensor {
  top: 0;
  width: 46%;
  height: 19px;
  border-radius: 0 0 13px 13px;
}
.phone-frame--island .phone-frame__sensor {
  width: 34%;
  height: 13px;
  border-radius: 999px;
}
.phone-frame--compact { width: 157px; height: 340px; border-radius: 27px; }
.phone-frame--standard { width: 171px; height: 371px; }
.phone-frame--pro { width: 178px; height: 387px; border-color: #77736b; }
.phone-frame--max { width: 190px; height: 413px; border-radius: 35px; }
.phone-frame--air { width: 181px; height: 393px; border-width: 5px; border-color: #68686d; }

/* === installation steps === */
.block {
  display: flex;
  gap: 16px;
  margin: 28px 0;
}
.block__num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--text);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.block__content { flex: 1; }
.block__content h3 {
  margin: 4px 0 14px;
  font-size: 19px;
  font-weight: 600;
}
.block__instr {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 12px;
}
.block__instr b { color: var(--text); font-weight: 600; }
.block__instr u { color: var(--text); }

.fields { margin-bottom: 18px; }
.fields label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
  font-weight: 500;
}
.fields .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.fields input, .fields select, .block__content > select, .block__content > label + select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
}
.block__content > label {
  display: block; font-size: 13px; color: var(--muted);
  margin: 14px 0 6px; font-weight: 500;
}
.fields input:focus, .fields select:focus, .block__content select:focus {
  outline: none; border-color: var(--accent);
}

.url-row {
  display: flex; gap: 8px;
}
#generated-url {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 11px 12px;
  font-size: 13px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.copy-btn {
  width: 44px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); cursor: pointer;
  font-size: 18px;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.ok { color: #4ade80; border-color: #4ade80; }
.copy-btn:disabled { opacity: .4; cursor: not-allowed; }

.warning {
  background: var(--warn-bg);
  border: 1px solid #4a3d20;
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--warn-fg);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 18px;
}
.warning b { color: #f4c64b; }

.modal__footer {
  display: flex; justify-content: space-between;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-text {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 8px 4px; font-size: 14px; font-family: inherit;
}
.btn-text:hover { color: var(--text); }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .cards .card:nth-child(3) { grid-column: auto; }
  .hero { padding-top: 20px; }
  .modal__panel { padding: 34px 22px 22px; }
  .model-picker { grid-template-columns: 1fr; gap: 26px; }
  .phone-preview { min-height: 380px; }
  .phone-frame--compact { width: 143px; height: 310px; }
  .phone-frame--standard { width: 153px; height: 332px; }
  .phone-frame--pro { width: 158px; height: 344px; }
  .phone-frame--max { width: 166px; height: 361px; }
  .phone-frame--air { width: 161px; height: 350px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
