:root {
  --ink: #0b1018;
  --ink-soft: #151c28;
  --mist: #9aabbc;
  --fog: #d7e0ea;
  --paper: #eef3f7;
  --signal: #3ec9b0;
  --signal-deep: #1f8f7d;
  --ember: #e29a5a;
  --danger: #d47a6a;
  --line: rgba(215, 224, 234, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Syne", sans-serif;
  --font-body: "Figtree", sans-serif;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  background: var(--ink);
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(62, 201, 176, 0.18), transparent 55%),
    radial-gradient(900px 600px at 88% 8%, rgba(226, 154, 90, 0.12), transparent 50%),
    linear-gradient(165deg, #101826 0%, #0b1018 48%, #080c12 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}

.orb-a {
  width: 320px;
  height: 320px;
  left: -60px;
  top: 20%;
  background: rgba(62, 201, 176, 0.22);
}

.orb-b {
  width: 420px;
  height: 420px;
  right: -120px;
  top: 55%;
  background: rgba(90, 130, 180, 0.18);
  animation-duration: 24s;
  animation-direction: alternate-reverse;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(30px, -24px, 0) scale(1.08);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  backdrop-filter: blur(16px);
  background: rgba(11, 16, 24, 0.72);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}

.mark-pin {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(62, 201, 176, 0.18);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.86);
    opacity: 0.7;
  }
}

.tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 28, 40, 0.8);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--mist);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.tab.is-active,
.tab:hover {
  color: var(--ink);
  background: var(--fog);
}

.topbar-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--mist);
  font-size: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(21, 28, 40, 0.75);
  border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  cursor: pointer;
  max-width: 14rem;
}

.account-chip:hover {
  border-color: rgba(62, 201, 176, 0.35);
  color: var(--fog);
}

.account-chip.is-live {
  color: var(--paper);
}

.account-chip img {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-soft);
}

.account-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gsi-slot {
  min-height: 0;
}

.google-signin-card {
  align-items: start;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.2rem 0.7rem 0.85rem;
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.google-signin-btn:hover {
  background: #f6f7f8;
}

.google-signin-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--mist);
  font-size: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(21, 28, 40, 0.75);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}

.device-chip:hover {
  border-color: rgba(62, 201, 176, 0.35);
  color: var(--fog);
}

.device-chip .pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--mist);
}

.device-chip.is-live .pulse {
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(62, 201, 176, 0.2);
}

.device-chip.is-warn .pulse {
  background: var(--ember);
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.hero {
  min-height: calc(100vh - 5.5rem);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(2rem, 6vh, 4rem) 0 clamp(3rem, 8vh, 5rem);
}

.brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.5rem);
  letter-spacing: -0.06em;
  line-height: 0.9;
  background: linear-gradient(120deg, #f4f8fb 20%, #3ec9b0 70%, #e29a5a 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brand-in 0.9s var(--ease) both;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
  animation: rise 0.8s 0.1s var(--ease) both;
}

.lede {
  margin: 1rem 0 0;
  max-width: 34ch;
  color: var(--mist);
  font-size: 1.05rem;
  line-height: 1.55;
  animation: rise 0.8s 0.18s var(--ease) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  animation: rise 0.8s 0.26s var(--ease) both;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s;
}

.btn.primary {
  background: var(--signal);
  color: var(--ink);
  font-weight: 700;
}

.btn.primary:hover {
  transform: translateY(-1px);
  background: #54d8c0;
}

.btn.ghost {
  background: transparent;
  color: var(--fog);
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: rgba(215, 224, 234, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
}

.btn.small {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}

.hero-visual {
  position: relative;
  min-height: 320px;
  animation: rise 1s 0.2s var(--ease) both;
}

.wave-stage {
  position: relative;
  height: 100%;
  min-height: 340px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(30, 42, 58, 0.9), rgba(12, 18, 28, 0.95)),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 24px,
      rgba(215, 224, 234, 0.03) 24px,
      rgba(215, 224, 234, 0.03) 25px
    );
  border: 1px solid var(--line);
}

.wave {
  position: absolute;
  inset: 18% 0 0;
  width: 100%;
  height: 70%;
}

.wave-path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.wave-back {
  stroke: rgba(90, 130, 180, 0.35);
}

.wave-mid {
  stroke: rgba(226, 154, 90, 0.45);
}

.wave-front {
  stroke: var(--signal);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px rgba(62, 201, 176, 0.35));
}

.pin-silhouette {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  animation: float-pin 4.5s ease-in-out infinite;
}

@keyframes float-pin {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - 8px));
  }
}

.pin-head {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f2f6fa, #9eb0c2);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.18);
}

.pin-body {
  width: 18px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c9d4e0, #6d7f93);
}

.panel {
  display: none;
  padding: 0 0 2rem;
  animation: rise 0.55s var(--ease) both;
}

.panel.is-active {
  display: block;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}

.panel-head p {
  margin: 0.55rem 0 0;
  color: var(--mist);
  max-width: 50ch;
}

.filter-row,
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 1.5rem 0 1rem;
}

.chip,
.icon-btn {
  border: 1px solid var(--line);
  background: rgba(21, 28, 40, 0.75);
  color: var(--mist);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chip.is-active,
.chip:hover,
.icon-btn:hover {
  color: var(--ink);
  background: var(--fog);
  border-color: transparent;
}

.recording-list {
  display: grid;
  gap: 0.75rem;
}

.recording {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(24, 32, 46, 0.9), rgba(14, 20, 30, 0.92));
  transition: border-color 0.2s, transform 0.2s var(--ease);
}

.recording:hover {
  border-color: rgba(62, 201, 176, 0.35);
  transform: translateY(-1px);
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.6rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(62, 201, 176, 0.15);
  color: var(--signal);
}

.kind-badge.translate {
  background: rgba(226, 154, 90, 0.16);
  color: var(--ember);
}

.kind-badge.task {
  background: rgba(154, 171, 188, 0.18);
  color: var(--fog);
}

.recording h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.recording .meta {
  margin: 0.35rem 0 0;
  color: var(--mist);
  font-size: 0.88rem;
}

.recording .translation {
  margin: 0.55rem 0 0;
  color: #b7c7d6;
  font-size: 0.95rem;
}

.recording time {
  color: var(--mist);
  font-size: 0.82rem;
  white-space: nowrap;
}

.delete-btn {
  border: 0;
  background: transparent;
  color: var(--mist);
  cursor: pointer;
  padding: 0.2rem;
  opacity: 0.7;
}

.delete-btn:hover {
  color: #f0b0a0;
  opacity: 1;
}

.empty {
  color: var(--mist);
  padding: 1.5rem 0;
}

.language-current {
  margin: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.language-current .label {
  color: var(--mist);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.language-current strong {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.language-greeting {
  margin: 0.75rem 0 0;
  max-width: 36ch;
  color: var(--signal);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  min-height: 1.5em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.language-greeting.is-visible {
  opacity: 1;
  transform: none;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.lang-option {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(18, 25, 36, 0.85);
  color: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.lang-option:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 201, 176, 0.4);
}

.lang-option.is-selected {
  background: linear-gradient(160deg, rgba(62, 201, 176, 0.2), rgba(18, 25, 36, 0.95));
  border-color: var(--signal);
}

.lang-option .native {
  display: block;
  margin-top: 0.25rem;
  color: var(--mist);
  font-size: 0.9rem;
}

.cal-toolbar h3 {
  margin: 0;
  min-width: 10rem;
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.cal-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.25rem;
  align-items: start;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  padding: 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(16, 22, 32, 0.85);
}

.dow {
  text-align: center;
  color: var(--mist);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0 0.6rem;
}

.day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 0.2rem;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.day:hover {
  background: rgba(255, 255, 255, 0.04);
}

.day.is-muted {
  color: rgba(154, 171, 188, 0.35);
}

.day.is-today {
  border-color: rgba(62, 201, 176, 0.45);
}

.day.is-selected {
  background: rgba(62, 201, 176, 0.18);
  border-color: var(--signal);
}

.day.has-events::after {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--ember);
}

.day-detail {
  padding: 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(16, 22, 32, 0.85);
  min-height: 280px;
}

.day-detail h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.event-list li {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.event-list .time {
  display: block;
  color: var(--signal);
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.cal-note {
  margin: 1rem 0 0;
  color: var(--mist);
  font-size: 0.85rem;
}

.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: var(--mist);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.device-card {
  margin-top: 1.5rem;
  padding: 1.35rem 1.4rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24, 32, 46, 0.95), rgba(12, 18, 28, 0.92));
  display: grid;
  gap: 1.25rem;
}

.google-status {
  margin-top: 0.5rem;
}

.google-flags {
  list-style: none;
  margin: 0;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: grid;
  gap: 0.55rem;
}

.google-card {
  margin-top: 1.25rem;
  padding: 1.35rem 1.4rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(24, 32, 46, 0.95), rgba(12, 18, 28, 0.92));
  display: grid;
  gap: 0.85rem;
}

.google-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.google-card .hint {
  margin: 0;
  color: var(--mist);
  line-height: 1.45;
  font-size: 0.95rem;
}

.google-card textarea {
  width: 100%;
  min-height: 9rem;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}

.google-card input[type="url"],
.google-card input[type="text"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.google-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.google-card .btn {
  justify-self: start;
  text-decoration: none;
}

.device-card-status {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.device-dot {
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--mist);
  flex-shrink: 0;
}

.device-dot.is-connected {
  background: var(--signal);
  box-shadow: 0 0 0 5px rgba(62, 201, 176, 0.2);
}

.device-card-status strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.device-card-status p {
  margin: 0.3rem 0 0;
  color: var(--mist);
}

.device-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.device-hint {
  margin: 0;
  color: var(--mist);
  font-size: 0.88rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(5, 8, 12, 0.72);
  backdrop-filter: blur(10px);
  animation: rise 0.35s var(--ease) both;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(440px, 100%);
  padding: 1.75rem 1.6rem 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(62, 201, 176, 0.25);
  background:
    radial-gradient(500px 220px at 10% 0%, rgba(62, 201, 176, 0.16), transparent 55%),
    linear-gradient(165deg, #182131, #0d131c 70%);
  box-shadow: var(--shadow);
  animation: brand-in 0.45s var(--ease) both;
}

.modal-eyebrow {
  margin: 0 0 0.55rem;
  color: var(--signal);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.04em;
}

.modal p {
  margin: 0.75rem 0 0;
  color: var(--mist);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.modal-note {
  margin-top: 1rem !important;
  font-size: 0.85rem;
  min-height: 1.2em;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .topbar-end,
  .device-chip {
    justify-self: start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    min-height: 240px;
  }

  .wave-stage {
    min-height: 240px;
  }

  .cal-layout {
    grid-template-columns: 1fr;
  }

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