/* my-calendar — pop / playful design system */

:root {
  --bg: #fff7ec;
  --surface: #ffffff;
  --ink: #1a1326;
  --ink-soft: #5b4f6e;
  --muted: #8a7f9b;

  --coral: #ff7a59;
  --violet: #7c5cff;
  --mint: #5fd7b5;
  --lemon: #ffd84d;
  --pink: #ff8ac4;
  --sky: #6bc6ff;

  --border: #efe5d5;

  --shadow-pop: 4px 4px 0 var(--ink);
  --shadow-pop-sm: 2px 2px 0 var(--ink);

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  font-family:
    "Space Grotesk", ui-rounded, "SF Pro Rounded", -apple-system,
    BlinkMacSystemFont, "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== decorative blobs ===== */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.blob-a { width: 420px; height: 420px; background: var(--coral); top: -120px; left: -80px; }
.blob-b { width: 360px; height: 360px; background: var(--violet); top: 30%; right: -120px; }
.blob-c { width: 380px; height: 380px; background: var(--mint); bottom: -160px; left: 25%; opacity: 0.4; }

/* ===== layout ===== */
main {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 18px 100px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(255, 247, 236, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 18px;
}
.brand .logo {
  font-size: 26px;
  color: var(--coral);
  transform: rotate(-12deg);
  display: inline-block;
}

.lang {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-pop-sm);
  cursor: pointer;
}

footer {
  text-align: center;
  padding: 32px 16px 24px;
  position: relative;
  z-index: 1;
}

/* ===== sections ===== */
#hero, #builder, #result {
  position: relative;
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 44px 32px;
  box-shadow: var(--shadow-pop);
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#hero { text-align: center; }
#hero h1 { align-items: center; }
#hero .lede { margin-left: auto; margin-right: auto; }
#hero .cta-row { justify-content: center; }
#hero p.muted { text-align: center; margin: 10px 0 0; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

/* ===== typography ===== */
h1 {
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: -0.03em;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
h1 .kicker {
  font-size: 0.46em;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
  text-transform: lowercase;
}
h1 .hero-title {
  background: linear-gradient(95deg, var(--coral) 0%, var(--violet) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  font-size: clamp(22px, 4vw, 30px);
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h3 { font-size: 16px; margin: 0; font-weight: 600; }

.lede {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  line-height: 1.5;
  max-width: 56ch;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ===== eyebrow / section labels ===== */
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coral);
  margin: 0 0 4px;
}

/* ===== landing sections ===== */
#landing { display: flex; flex-direction: column; gap: 36px; }

.lp-section {
  padding: 8px 4px;
}
.lp-section .section-head { margin-bottom: 24px; }

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.step {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-pop-sm);
  position: relative;
}
.step h3 { margin: 12px 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--lemon);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
}
.step:nth-child(2) .step-num { background: var(--mint); }
.step:nth-child(3) .step-num { background: var(--pink); }

/* example event cards */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.example {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-pop-sm);
  position: relative;
  overflow: hidden;
}
.example::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 8px;
}
.example-coral::before { background: var(--coral); }
.example-violet::before { background: var(--violet); }
.example-mint::before { background: var(--mint); }
.example-pink::before { background: var(--pink); }
.example { padding-left: 22px; }
.example-time {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.example-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.example-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.4; }

/* why cards */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.why-card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-pop-sm);
}
.why-card .why-emoji { font-size: 36px; line-height: 1; display: block; margin-bottom: 8px; }
.why-card h3 { font-size: 17px; margin: 0 0 6px; }
.why-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

/* calendar name field */
.cal-name-label {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 4px;
}
.cal-name-label > span { font-weight: 600; color: var(--ink); }
.cal-name-label input { background: var(--surface); }

/* faq */
.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop-sm);
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.faq-item[open] { box-shadow: 4px 4px 0 var(--violet); }
.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  list-style: none;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q { flex: 1; }
.faq-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--lemon);
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease;
}
.faq-item[open] .faq-toggle {
  transform: rotate(45deg);
  background: var(--coral);
}
.faq-a {
  padding: 0 20px 18px;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 14px;
}
.faq-a ol, .faq-a ul {
  margin: 8px 0 0;
  padding-left: 22px;
}
.faq-a li { margin-bottom: 4px; }
.faq-a strong { color: var(--ink); }
.faq-a code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* bottom CTA */
#cta-bottom {
  text-align: center;
  background: linear-gradient(135deg, var(--lemon) 0%, var(--pink) 100%);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 48px 28px;
  box-shadow: var(--shadow-pop);
}
#cta-bottom h2 {
  font-size: clamp(22px, 4vw, 30px);
  margin: 0 0 22px;
  line-height: 1.2;
}
#cta-bottom .muted { color: rgba(26, 19, 38, 0.7); margin-top: 14px; }

/* ===== buttons ===== */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta-row.centered { justify-content: center; }
.cta-row.end { justify-content: flex-end; margin-top: 14px; }

.btn-primary, .btn-ghost, .btn-text {
  font: inherit;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2.5px solid var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-pop);
}
.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--coral);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}
.btn-primary.big {
  font-size: 17px;
  padding: 16px 28px;
  background: linear-gradient(95deg, var(--coral), var(--violet));
  color: white;
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop-sm);
}
.btn-ghost:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--lemon);
}

.btn-text {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 4px;
}
.btn-text:hover { color: var(--coral); }

.block { width: 100%; }

.iconbtn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  border: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  flex-shrink: 0;
}
.iconbtn:hover { color: var(--coral); border-color: var(--coral); }

.hidden { display: none !important; }

/* ===== inputs ===== */
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
label > span { font-weight: 600; }

input[type="text"], input[type="number"], select {
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: box-shadow 0.12s ease;
}
input:focus, select:focus { box-shadow: var(--shadow-pop-sm); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.grid-tight { gap: 10px; }

/* ===== preset cards ===== */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.preset-card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  text-align: center;
  box-shadow: var(--shadow-pop-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}
.preset-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--violet);
}
.preset-card.selected {
  background: var(--lemon);
  box-shadow: 4px 4px 0 var(--coral);
  transform: translate(-2px, -2px);
}
.preset-card .emoji {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 4px;
  transform: rotate(-4deg);
  display: inline-block;
}
.preset-card.selected .emoji { transform: rotate(6deg) scale(1.06); }
.preset-card .label { font-weight: 700; font-size: 15px; color: var(--ink); }
.preset-card .cadence { font-size: 11px; font-weight: 500; }

/* ===== selected category cards ===== */
#categories {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
}

.cat-card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 14px 16px 14px 22px;
  box-shadow: var(--shadow-pop-sm);
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 8px;
  background: var(--coral);
}
.cat-card:nth-child(2n)::before { background: var(--violet); }
.cat-card:nth-child(3n)::before { background: var(--mint); }
.cat-card:nth-child(4n)::before { background: var(--pink); }
.cat-card:nth-child(5n)::before { background: var(--sky); }

.cat-head { display: flex; align-items: center; gap: 10px; }
.cat-emoji { font-size: 22px; line-height: 1; }
.cat-badge {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: center;
}
.cat-people-label {
  margin-top: 10px;
  gap: 6px;
}
.cat-people-label > span {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.cat-people {
  font-size: 16px !important; /* mobile: prevent iOS zoom-on-focus */
  font-weight: 500;
}
.cat-name {
  font-weight: 600;
}

.cat-details { margin-top: 8px; }
.cat-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 0;
  list-style: none;
}
.cat-details summary::-webkit-details-marker { display: none; }
.cat-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
  color: var(--coral);
}
.cat-details[open] summary::before { transform: rotate(90deg); }
.cat-details[open] {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 10px 0 4px;
}
.cat-details[open] > .grid + .chip-row,
.cat-details[open] > .chip-row + .chip-row { margin-top: 4px; }

/* ===== chips ===== */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  transition: transform 0.08s ease, background 0.12s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip.active { background: var(--ink); color: var(--bg); }
.weekdays .chip { min-width: 44px; text-align: center; }
.gestures .chip.active { background: var(--coral); color: var(--bg); border-color: var(--ink); }

/* ===== advanced ===== */
details.advanced {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 8px 16px;
}
details.advanced summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 6px 0;
}
details.advanced[open] { padding-bottom: 14px; }
details.advanced[open] > .grid { margin-top: 10px; }

/* ===== preview list (next 14 days) ===== */
.preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 28px;
}
.preview-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-pop-sm);
}
.preview-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 2px solid var(--ink);
}
.preview-day { font-weight: 700; font-size: 14px; text-transform: uppercase; }
.preview-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.preview-body { flex: 1; }
.preview-title { font-weight: 600; font-size: 15px; }
.preview-sub { margin-top: 2px; }
.preview-empty {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ===== subscribe card ===== */
.subscribe-card {
  background: linear-gradient(160deg, var(--bg) 0%, #fdf0e0 100%);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-pop-sm);
  margin-bottom: 14px;
}
.subscribe-card h3 { margin: 0 0 4px; font-size: 18px; }
.subscribe-card > .muted { margin: 0 0 16px; }
.subscribe-card .result-grid { margin: 0; }

/* ===== result ===== */
.result-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: flex-start;
  margin: 12px 0 18px;
}

.qr-card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 4px 4px 0 var(--mint);
}
.qr-card canvas {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: #fff;
}
.qr-card p { margin: 0; }

.actions-card { display: flex; flex-direction: column; gap: 12px; }

.urlbox { gap: 8px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

/* ===== responsive ===== */
@media (max-width: 640px) {
  #hero, #builder, #result { padding: 28px 20px; }
  .preset-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .preset-card { padding: 14px 10px; }
  .preset-card .emoji { font-size: 32px; }
  .result-grid { grid-template-columns: 1fr; }
  .qr-card { align-self: center; }
  h1 .kicker { font-size: 0.52em; }

  /* Tighter cat-card on phones; less wasted side padding */
  .cat-card { padding: 14px 14px 14px 20px; }
  .cat-card::before { width: 6px; }
  .cat-name { font-size: 15px; padding: 4px 6px; }

  /* Form grid: keep two columns on phones (110px min instead of 130) */
  .grid-tight { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }

  /* Weekdays: equal 7-col grid so they always fit on one row */
  .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .weekdays .chip {
    min-width: 0;
    padding: 8px 2px;
    font-size: 11px;
    letter-spacing: -0.01em;
  }

  /* Gestures: ensure chips wrap properly without overlap */
  .gestures .chip { font-size: 12px; padding: 7px 11px; }

  /* Inputs slightly smaller text to fit padding */
  input[type="text"], input[type="number"] { font-size: 14px; padding: 10px 12px; }

  /* On phones the subscribe-card becomes a plain header + content group
     (no nested card). Buttons and QR card carry their own borders/shadows
     and aren't constrained by a parent box, so no visual leakage. */
  .subscribe-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 0 4px;
    box-shadow: none;
  }
  .subscribe-card h3 { font-size: 17px; }
  .qr-card {
    width: 100%;
    max-width: 280px;
    margin: 8px auto 4px;
    padding: 14px;
    box-shadow: 2px 2px 0 var(--mint);
  }
  .actions-card { padding: 0 2px 4px 0; gap: 10px; }
  .actions-card .btn-primary,
  .actions-card .btn-ghost { box-shadow: 2px 2px 0 var(--ink); }

  .copyrow { flex-direction: row; gap: 6px; }
  .copyrow input { min-width: 0; flex: 1; }
  .copyrow .btn-ghost { padding: 10px 14px; }
}

@media (max-width: 380px) {
  .weekdays .chip { font-size: 10px; padding: 7px 0; }
  .qr-card { padding: 12px; }
}
