:root {
  color-scheme: light;
  --background: #f7f9fc;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #dbe3ef;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --doodle-mask-color: #000;
  --doodle-mask-fade: rgba(0, 0, 0, 0);
  --home-mask-scale: 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #e0edff 0, var(--background) 42rem);
}

.results-page--fullscreen {
  overflow: hidden;
  background: #fff;
}


.home-page {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.home-shell {
  width: min(100%, 46rem);
  text-align: center;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.tagline, .muted, .source-note {
  color: var(--muted);
}

.tagline {
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}

.search-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.search-form button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: 700 1rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  transition: background 160ms ease, transform 160ms ease;
}

.search-form button:hover {
  background: linear-gradient(180deg, #ff6818 0%, #f01808 100%);
  transform: translateY(-2px);
}

.search-form--hero {
  padding: 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.search-form--hero input {
  padding: 1rem 1.25rem;
  font-size: 1.15rem;
}

.search-form--hero button {
  padding: 0 1.5rem;
}

.results-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  padding: 1rem;
  background: rgba(247, 249, 252, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.search-form--compact {
  max-width: 36rem;
}

.search-form--compact input {
  padding: 0.75rem 1rem;
}

.search-form--compact button {
  padding: 0 1.15rem;
}

.results-shell {
  width: min(100% - 2rem, 70rem);
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.results-shell h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.google-frame-shell {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.google-frame-shell--fullscreen {
  width: 100vw;
  height: 100vh;
}

#google-results {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.doodle-mask {
  --mask-height: clamp(4.75rem, 16vw, 6rem);
  --mask-main-width: clamp(10rem, 30vw, 12.5rem);
  --mask-fade-width: clamp(1.25rem, 4vw, 2.25rem);

  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: calc(var(--mask-main-width) + var(--mask-fade-width));
  height: var(--mask-height);
  min-width: 4rem;
  min-height: 3rem;
  max-width: 90vw;
  max-height: 60vh;
  overflow: hidden;
  resize: both;
  border-bottom-right-radius: calc(var(--mask-height) * 0.52);
  background: linear-gradient(to right, var(--doodle-mask-color) 0 calc(100% - var(--mask-fade-width)), var(--doodle-mask-fade));
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 95%, rgba(0, 0, 0, 0));
  mask-image: linear-gradient(to bottom, #000 0 95%, rgba(0, 0, 0, 0));
}

.doodle-mask::before,
.doodle-mask::after {
  display: none;
}

.doodle-mask:hover,
.doodle-mask:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.42);
  outline-offset: -2px;
}

.doodle-mask--dragging {
  cursor: grabbing;
}

@media (max-width: 560px) {
  .search-form { flex-direction: column; }
  .search-form button { padding: 0.9rem 1rem; }
  .search-form--hero { border-radius: 1.5rem; }

  .doodle-mask {
    --mask-height: clamp(4.5rem, 22vw, 5.25rem);
    --mask-main-width: clamp(8rem, 48vw, 10rem);
    --mask-fade-width: clamp(1rem, 8vw, 1.75rem);

    left: 50%;
    transform: translateX(-50%);
    max-width: 95vw;
  }
}

.empty-results {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.google-home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0;
  background: radial-gradient(circle at top, rgba(232, 244, 255, 0.72) 0, rgba(246, 251, 255, 0.58) 28rem, #fbfdff 100%);
}

.google-home-nav {
  position: relative;
  min-height: 3.5rem;
  padding: 0;
  font-size: 0.9rem;
}

.google-home-nav nav {
  position: fixed;
  top: 8px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.google-home a,
.google-home-footer a {
  color: #202124;
  text-decoration: none;
}

.google-home a:hover,
.google-home-footer a:hover {
  text-decoration: underline;
}

.apps-icon {
  width: 1.5rem;
  color: #5f6368;
  font-size: 0.7rem;
  line-height: 0.32rem;
  text-align: center;
  letter-spacing: 0.1rem;
  transform: rotate(90deg);
}

.sign-in-button,
.get-nodoodle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.3rem;
  min-height: 2.5rem;
  border-radius: 999px;
  background: #2f5bd3;
  color: #fff !important;
  font-weight: 700;
}

.get-nodoodle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: auto;
  min-height: 1.75rem;
  padding: 0 0.7rem;
  border: 1px solid rgba(63, 73, 212, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #3f49d4 !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  opacity: 0;
  box-shadow: none;
  text-decoration: none !important;
  transition: opacity 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.get-nodoodle-button::after {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  background: currentColor;
  clip-path: path("M10 2a1 1 0 0 1 1 1v8.59l2.3-2.3a1 1 0 1 1 1.4 1.42l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.42L9 11.59V3a1 1 0 0 1 1-1ZM4 17a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z");
}

.get-nodoodle-button:hover,
.get-nodoodle-button:focus-visible {
  opacity: 1;
  border-color: rgba(63, 73, 212, 0.55);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none !important;
}

.google-home-shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(4rem, 12vh, 7rem);
}

.home-doodle-mask {
  width: min(34rem, 66vw);
  height: clamp(7rem, 14vw, 11rem);
  border-top-left-radius: 0.8rem;
  border-top-right-radius: 4rem;
  border-bottom-right-radius: 1.6rem;
  background: var(--doodle-mask-color);
  transform: scale(var(--home-mask-scale));
  transform-origin: center;
}

.mask-color-controls {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  display: flex;
  gap: 0.5rem;
}

.mask-color-button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(32, 33, 36, 0.22);
  border-radius: 50%;
  opacity: 0;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}

.mask-color-button--black {
  background: #000;
}

.mask-color-button--white {
  background: #fff;
}

.mask-color-button:hover,
.mask-color-button:focus-visible {
  opacity: 1;
  transform: scale(1.06);
}

.coffee-button {
  position: fixed;
  right: 18px;
  bottom: 74px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  min-height: 2.25rem;
  border-radius: 999px;
  background: #ffd84d;
  color: #000 !important;
  font-weight: 800;
  opacity: 0;
  text-decoration: none !important;
  transition: opacity 160ms ease, transform 160ms ease;
}

.coffee-button:hover,
.coffee-button:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.home-mask-scale-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.home-mask-scale-controls:hover,
.home-mask-scale-controls:focus-within {
  opacity: 1;
  transform: translateY(-1px);
}

.home-mask-scale-value {
  min-width: 3rem;
  color: #202124;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.home-mask-scale-button {
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 50%;
  background: #202124;
  color: #fff;
  cursor: pointer;
  font: 800 1rem/1 Arial, sans-serif;
}

.google-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  width: min(43rem, calc(100vw - 2rem));
  min-height: 3.2rem;
  margin-top: 3rem;
  padding: 0 1.25rem;
  border: 1px solid #dfe1e5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.16);
}

.google-search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 1.15rem/1.5 Arial, sans-serif;
}

.google-search-form--simple input {
  text-align: left;
}

.download-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 99, 235, 0.18), transparent 28rem),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 48%, #ffffff 100%);
}

.download-shell {
  width: min(100% - 2rem, 68rem);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.download-hero {
  display: grid;
  justify-items: center;
  text-align: center;
}

.download-kicker {
  margin: 0 0 1rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.download-hero h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
}

.download-copy {
  max-width: 42rem;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.download-card {
  width: min(100%, 28rem);
  padding: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: var(--shadow);
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(4.75rem, 9vw, 7.5rem);
  width: 100%;
  padding: 0 clamp(2rem, 6vw, 4rem);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5a0a 0%, #ff220f 100%);
  color: #fff;
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.download-button:hover {
  background: linear-gradient(180deg, #ff6818 0%, #f01808 100%);
  transform: translateY(-2px);
}

.download-availability {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.download-availability a {
  color: var(--accent);
  font-weight: 800;
}
