:root {
  --bg: #f8f7f4;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #1a1a1c;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.06);
  --accent: #5e6ad2;
  --accent-strong: #4754c0;
  --ink: #000000;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  --top-safe: env(safe-area-inset-top, 0px);
  --bottom-safe: env(safe-area-inset-bottom, 0px);
  --poster-line: rgba(17, 17, 17, 0.12);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.95rem 1rem;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(52, 92, 70, 0.4);
  background: #fff;
}

.ios-shell {
  min-height: 100svh;
  background:
    radial-gradient(circle at 18% 18%, rgba(148, 163, 196, 0.22), transparent 18%),
    radial-gradient(circle at 82% 24%, rgba(0, 0, 0, 0.05), transparent 22%),
    repeating-linear-gradient(
      132deg,
      rgba(24, 24, 28, 0.018) 0,
      rgba(24, 24, 28, 0.018) 1px,
      transparent 1px,
      transparent 16px
    ),
    repeating-linear-gradient(
      42deg,
      rgba(148, 163, 196, 0.04) 0,
      rgba(148, 163, 196, 0.04) 1px,
      transparent 1px,
      transparent 18px
    ),
    linear-gradient(180deg, #faf9f6 0%, #f3f2ef 48%, #eeedf0 100%);
}

.app-frame {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: calc(0.9rem + var(--top-safe)) 1rem 0.9rem;
  background: rgba(245, 244, 241, 0.76);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 14px 16px rgba(148, 163, 196, 0.25));
}

.nav-kicker {
  margin: 0 0 0.25rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.66rem;
  font-weight: 700;
  font-family: "Courier New", "SFMono-Regular", monospace;
}

.top-bar h1 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.1;
  font-weight: 800;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: -0.03em;
}

.screen-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 28ch;
}

.status-pill {
  white-space: nowrap;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(24, 24, 30, 0.05);
}

.screen-stack {
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.screen {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 1rem 1rem calc(6.5rem + var(--bottom-safe));
  overscroll-behavior-y: contain;
}

.screen.is-active {
  display: block;
  animation: screenIn 240ms ease;
}

.hero-card,
.group-card {
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.hero-card {
  padding: 1.15rem 1.15rem 1.2rem;
  margin-bottom: 0.9rem;
  min-height: 246px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.64)),
    linear-gradient(90deg, rgba(17, 17, 17, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(rgba(17, 17, 17, 0.05) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(
      145deg,
      rgba(24, 24, 28, 0.014) 0,
      rgba(24, 24, 28, 0.014) 1px,
      transparent 1px,
      transparent 16px
    );
  background-size: auto, 72px 72px, 72px 72px, auto;
}

.group-card {
  padding: 1.1rem 1rem;
  margin-bottom: 0.9rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.66)),
    linear-gradient(90deg, rgba(17, 17, 17, 0.04) 0 1px, transparent 1px 100%),
    linear-gradient(rgba(17, 17, 17, 0.03) 0 1px, transparent 1px 100%),
    repeating-linear-gradient(
      135deg,
      rgba(24, 24, 28, 0.014) 0,
      rgba(24, 24, 28, 0.014) 1px,
      transparent 1px,
      transparent 18px
    );
  background-size: auto, 84px 84px, 84px 84px, auto;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-halo {
  position: absolute;
  right: -8%;
  bottom: 4%;
  width: 74%;
  height: 82%;
  border-radius: 38% 42% 44% 40%;
  background:
    linear-gradient(180deg, rgba(148, 163, 196, 0.3), rgba(148, 163, 196, 0.12)),
    repeating-linear-gradient(
      45deg,
      rgba(148, 163, 196, 0.12) 0,
      rgba(148, 163, 196, 0.12) 1px,
      transparent 1px,
      transparent 13px
    );
  filter: blur(1px);
}

.hero-logo {
  position: absolute;
  right: -1.2rem;
  top: -0.4rem;
  width: 13.8rem;
  opacity: 0.94;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 16px 24px rgba(148, 163, 196, 0.18));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 15rem;
}

.hero-card h2,
.section-heading h3 {
  margin: 0;
}

.hero-card h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.hero-tags span {
  padding: 0.38rem 0.65rem;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(24, 24, 28, 0.08);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "Courier New", "SFMono-Regular", monospace;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.section-heading h3 {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
}

.small-note,
label,
.result-surface {
  color: var(--muted);
}

label {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  font-size: 0.92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.action-button {
  flex-shrink: 0;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 0;
  background:
    linear-gradient(180deg, #252629 0%, #17181b 100%);
  color: #f3f4f7;
  padding: 0.85rem 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-family: "Courier New", "SFMono-Regular", monospace;
  box-shadow:
    0 14px 26px rgba(22, 22, 25, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.action-button:active {
  transform: scale(0.98);
}

.action-button:disabled {
  opacity: 0.72;
}

.action-button--secondary {
  margin-top: 0.35rem;
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink);
  box-shadow: none;
}

.result-surface {
  margin-top: 0.4rem;
  border-top: 1px solid rgba(60, 60, 67, 0.08);
  padding-top: 1rem;
  min-height: 140px;
}

.empty-state {
  display: flex;
  align-items: center;
}

.result-stack {
  display: grid;
  gap: 1rem;
}

.result-block {
  display: grid;
  gap: 0.42rem;
}

.result-label {
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  font-weight: 800;
}

.result-value {
  color: var(--text);
  line-height: 1.5;
}

.result-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.news-item {
  padding: 0.85rem 0;
  border-top: 1px solid rgba(60, 60, 67, 0.08);
}

.news-item:first-child {
  padding-top: 0;
  border-top: none;
}

.news-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

.install-hint {
  padding: 0.95rem 1rem;
  margin-bottom: 0.9rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(148, 163, 196, 0.14), rgba(148, 163, 196, 0.08)),
    repeating-linear-gradient(
      135deg,
      rgba(24, 24, 28, 0.03) 0,
      rgba(24, 24, 28, 0.03) 1px,
      transparent 1px,
      transparent 14px
    );
  color: var(--text);
  line-height: 1.45;
}

.install-hint strong {
  color: var(--accent-strong);
}

.is-hidden {
  display: none;
}

.tab-bar {
  position: sticky;
  bottom: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  padding: 0.7rem 0.85rem calc(0.9rem + var(--bottom-safe));
  background: rgba(246, 245, 243, 0.88);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(60, 60, 67, 0.1);
}

.tab-button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.3rem 0.45rem;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
}

.tab-button.is-active {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(148, 163, 196, 0.18), rgba(148, 163, 196, 0.08));
}

.tab-glyph {
  width: 20px;
  height: 20px;
  position: relative;
  opacity: 0.8;
}

.glyph-today::before,
.glyph-project::before,
.glyph-outline::before,
.glyph-fyi::before,
.glyph-more::before,
.glyph-today::after,
.glyph-project::after,
.glyph-outline::after,
.glyph-fyi::after,
.glyph-more::after {
  content: "";
  position: absolute;
}

.glyph-today::before {
  inset: 2px 2px 2px 2px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--ink);
}

.glyph-today::after {
  inset: 7px 6px 2px 8px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--accent);
}

.glyph-project::before {
  width: 9px;
  height: 9px;
  left: 1px;
  top: 3px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.glyph-project::after {
  width: 12px;
  height: 12px;
  right: 1px;
  bottom: 2px;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.glyph-outline::before {
  inset: 3px;
  border: 1.6px solid var(--ink);
  border-radius: 6px;
}

.glyph-outline::after {
  left: 6px;
  right: 6px;
  top: 7px;
  height: 1.6px;
  background: var(--accent-strong);
  box-shadow: 0 4px 0 var(--accent-strong), 0 8px 0 var(--accent-strong);
}

.glyph-fyi::before {
  width: 4px;
  height: 4px;
  left: 3px;
  top: 8px;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 5px -4px 0 var(--accent), 10px 2px 0 var(--ink), 14px -3px 0 var(--accent);
}

.glyph-fyi::after {
  left: 3px;
  right: 3px;
  bottom: 4px;
  height: 1.5px;
  background: rgba(24, 24, 28, 0.16);
}

.glyph-more::before {
  inset: 3px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}

.glyph-more::after {
  width: 3px;
  height: 3px;
  left: 8px;
  top: 8px;
  background: var(--accent-strong);
  border-radius: 50%;
  box-shadow: -5px 0 0 var(--accent-strong), 5px 0 0 var(--accent-strong);
}

.tab-button:active {
  transform: scale(0.97);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 960px) {
  body {
    min-height: 100svh;
    padding: 1rem;
    background:
      linear-gradient(135deg, rgba(148, 163, 196, 0.2), transparent 28%),
      linear-gradient(315deg, rgba(24, 24, 28, 0.06), transparent 35%),
      linear-gradient(180deg, #efeee9 0%, #e6e3dc 100%);
  }

  .ios-shell {
    width: 100%;
    min-height: calc(100svh - 3rem);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid rgba(24, 32, 24, 0.06);
    box-shadow: 0 24px 70px rgba(20, 24, 25, 0.1);
    position: relative;
  }

  .ios-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(17, 17, 17, 0.035) 0 1px, transparent 1px 100%),
      linear-gradient(rgba(17, 17, 17, 0.025) 0 1px, transparent 1px 100%);
    background-size: 136px 136px;
    opacity: 0.4;
  }

  .app-frame {
    min-height: calc(100svh - 3rem);
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  .top-bar {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.2rem;
    padding: 2.1rem 1.35rem 1rem;
    border-right: 1px solid rgba(60, 60, 67, 0.08);
    border-bottom: none;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.18)),
      repeating-linear-gradient(
        145deg,
        rgba(24, 24, 28, 0.032) 0,
        rgba(24, 24, 28, 0.032) 1px,
        transparent 1px,
        transparent 21px
      );
    backdrop-filter: blur(18px);
  }

  .top-bar::after {
    content: "";
    position: absolute;
    left: 1.35rem;
    right: 1.35rem;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(24, 24, 28, 0.24), rgba(24, 24, 28, 0));
  }

  .top-brand {
    align-items: flex-start;
    gap: 1rem;
  }

  .brand-mark {
    width: 72px;
    height: 72px;
    filter: drop-shadow(0 20px 26px rgba(148, 163, 196, 0.22));
  }

  .top-bar h1 {
    font-size: clamp(2.8rem, 4vw, 3.6rem);
    line-height: 0.94;
  }

  .screen-subtitle {
    max-width: 22ch;
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .status-pill {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(31, 33, 36, 0.72);
    border: none;
  }

  .screen-stack {
    grid-column: 2;
    grid-row: 1 / span 2;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.12));
  }

  .screen {
    padding: 2.2rem 2.4rem 2.7rem;
  }

  .screen.is-active:not([data-screen="today"]) {
    display: block;
  }

  .screen.is-active:not([data-screen="today"]) .group-card {
    max-width: 880px;
  }

  .screen[data-screen="today"].is-active {
    display: grid;
    grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
    gap: 1.4rem;
    align-content: start;
  }

  .screen[data-screen="today"] .hero-card {
    min-height: 32rem;
    margin-bottom: 0;
    padding: 2rem 2rem 2.1rem;
    background:
      linear-gradient(160deg, rgba(255, 255, 255, 0.84), rgba(248, 248, 243, 0.56)),
      linear-gradient(90deg, rgba(24, 24, 28, 0.08) 0 1px, transparent 1px 100%),
      linear-gradient(rgba(24, 24, 28, 0.06) 0 1px, transparent 1px 100%);
    background-size: auto, 108px 108px, 108px 108px;
    border: 1px solid rgba(24, 24, 28, 0.08);
    box-shadow: 0 30px 80px rgba(18, 19, 25, 0.08);
  }

  .screen[data-screen="today"] .group-card {
    margin-bottom: 0;
    align-self: end;
  }

  .hero-copy {
    max-width: 21rem;
    padding-top: 0.3rem;
  }

  .hero-card h2 {
    font-size: clamp(4rem, 7vw, 6.2rem);
    line-height: 0.9;
    max-width: 8ch;
  }

  .hero-logo {
    width: 22rem;
    right: -3rem;
    top: -1rem;
    opacity: 0.9;
    filter: drop-shadow(0 20px 28px rgba(148, 163, 196, 0.12));
  }

  .hero-halo {
    right: -10%;
    bottom: -10%;
    width: 86%;
    height: 90%;
    border-radius: 34% 46% 40% 38%;
  }

  .hero-card::before {
    content: "";
    position: absolute;
    inset: auto auto 1.3rem 1.35rem;
    width: 11rem;
    height: 8rem;
    background:
      linear-gradient(135deg, rgba(17, 17, 17, 0.88), rgba(17, 17, 17, 0.62));
    clip-path: polygon(0 28%, 56% 0, 100% 34%, 79% 100%, 18% 82%);
    opacity: 0.9;
    mix-blend-mode: multiply;
  }

  .hero-card::after {
    content: "";
    position: absolute;
    right: 9rem;
    top: 2.2rem;
    width: 7rem;
    height: 7rem;
    background: rgba(148, 163, 196, 0.22);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: rotate(13deg);
  }

  .screen[data-screen="today"] .group-card::before,
  .screen.is-active:not([data-screen="today"]) .group-card::before {
    content: "";
    position: absolute;
    inset: auto -1.15rem -1.15rem auto;
    width: 10rem;
    height: 10rem;
    background: rgba(148, 163, 196, 0.22);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: rotate(10deg);
    pointer-events: none;
  }

  .screen[data-screen="today"] .group-card::after,
  .screen.is-active:not([data-screen="today"]) .group-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(135deg, transparent 0 72%, rgba(17, 17, 17, 0.07) 72% 73%, transparent 73% 100%);
    opacity: 0.75;
  }

  .group-card,
  .hero-card {
    border-radius: 10px;
  }

  .group-card {
    padding: 1.5rem 1.4rem;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.66));
    border: 1px solid rgba(24, 24, 28, 0.08);
    box-shadow: 0 22px 50px rgba(18, 19, 25, 0.06);
  }

  .section-heading {
    margin-bottom: 1.2rem;
  }

  .tab-bar {
    position: relative;
    bottom: auto;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.1rem;
    padding: 0.8rem 1rem 1.4rem 1rem;
    background: transparent;
    border-top: none;
    border-right: 1px solid rgba(60, 60, 67, 0.08);
    backdrop-filter: none;
  }

  .tab-button {
    grid-template-columns: 22px 1fr;
    justify-items: start;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 0.85rem;
    font-size: 0.92rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(24, 24, 28, 0.06);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-family: "Courier New", "SFMono-Regular", monospace;
  }

  .tab-label {
    white-space: nowrap;
    letter-spacing: 0.02em;
  }

  .tab-button.is-active {
    color: var(--ink);
    background:
      linear-gradient(90deg, rgba(17, 17, 17, 0.04), transparent);
    box-shadow: none;
    position: relative;
  }

  .tab-button.is-active::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 0.75rem;
    bottom: 0.75rem;
    width: 3px;
    background: linear-gradient(180deg, var(--ink), var(--accent-strong));
  }
}

@media (min-width: 1280px) {
  body {
    padding: 1.2rem;
  }

  .ios-shell {
    max-width: 1450px;
    margin: 0 auto;
  }

  .screen {
    padding: 2.5rem 2.85rem 3rem;
  }

  .screen[data-screen="today"].is-active {
    grid-template-columns: minmax(0, 1.32fr) minmax(420px, 0.72fr);
    gap: 1.7rem;
  }

  .screen[data-screen="today"] .hero-card {
    min-height: 36rem;
  }

  .hero-card h2 {
    font-size: clamp(4.6rem, 7vw, 7.2rem);
  }
}

@media (max-width: 420px) {
  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-pill {
    align-self: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
