/* Frozyn Web — the browser-in-a-page on the home page */

:root {
  color-scheme: dark light;
  --accent: #2f8fff;
  --ink: light-dark(#12223a, #e8f0fb);
  --ink-soft: light-dark(#4a5d78, #9fb2cc);
  --ice: light-dark(#d9e6f3, #0a111e);
  --page: light-dark(#f3f7fb, #0b1220);
  --card: light-dark(#ffffff, #121b2c);
  --glass: light-dark(rgba(255, 255, 255, 0.72), rgba(200, 225, 255, 0.1));
  --glass-hover: light-dark(rgba(255, 255, 255, 0.45), rgba(200, 225, 255, 0.06));
  --glass-strong: light-dark(rgba(255, 255, 255, 0.86), rgba(20, 31, 52, 0.86));
  --edge: light-dark(rgba(255, 255, 255, 0.9), rgba(170, 205, 255, 0.14));
  --stroke: light-dark(rgba(22, 64, 120, 0.13), rgba(150, 195, 255, 0.11));
  --shadow: light-dark(rgba(20, 55, 110, 0.18), rgba(0, 0, 0, 0.55));
  --link: light-dark(#1554c0, #8fc4ff);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  overflow: hidden;
  /* The window frame: one sheet of tinted ice, as in the desktop app. */
  background: linear-gradient(
      112deg,
      color-mix(in srgb, var(--accent) 30%, var(--ice)) 0%,
      color-mix(in srgb, var(--accent) 9%, var(--ice)) 38%,
      var(--ice) 64%,
      color-mix(in srgb, light-dark(#8fe3ff, #37c8e6) 16%, var(--ice)) 100%
    )
    fixed;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

#window {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
}

/* ------------------------------------------------------------------ */
/* Tab strip                                                          */
/* ------------------------------------------------------------------ */

#tabstrip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 3px;
  min-width: 0;
}

#mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
}

#mark:hover {
  background: var(--glass-hover);
}

#tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 220px;
  min-width: 96px;
  height: 36px;
  padding: 0 6px 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 13px;
  cursor: default;
  transition:
    background-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
  animation: tab-in 0.22s var(--ease);
}

@keyframes tab-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.tab:hover {
  background: var(--glass-hover);
}

.tab[aria-selected="true"] {
  background-color: var(--glass);
  background-image: linear-gradient(to top, color-mix(in srgb, var(--accent) 20%, transparent), transparent 75%);
  box-shadow:
    0 0 0 1px var(--stroke),
    inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.85), rgba(190, 220, 255, 0.07)),
    0 6px 16px -8px var(--shadow);
}

.tab .favicon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}

.tab .favicon img {
  width: 16px;
  height: 16px;
}

.tab .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: start;
}

.tab:not([aria-selected="true"]) .title {
  opacity: 0.82;
}

.tab .close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.tab .close:hover {
  background: var(--stroke);
}

.tab .close svg {
  width: 11px;
  height: 11px;
}

.grow {
  flex: 1;
}

.tool {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.14s var(--ease),
    color 0.14s var(--ease);
}

.tool:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
}

.tool:disabled {
  opacity: 0.35;
  cursor: default;
}

#tab-new svg {
  transition: transform 0.25s var(--ease);
}

#tab-new:hover svg {
  transform: rotate(90deg);
}

#get {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  flex: none;
  padding: 0 14px;
  border-radius: 11px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent));
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 20px -10px var(--accent);
  transition: filter 0.16s var(--ease);
}

#get:hover {
  filter: brightness(1.1);
}

/* ------------------------------------------------------------------ */
/* Toolbar                                                            */
/* ------------------------------------------------------------------ */

#toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 10px 7px;
}

#address {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  max-width: 820px;
  height: 36px;
  margin: 0 auto;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--glass);
  box-shadow:
    inset 0 0 0 1px var(--stroke),
    inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.85), rgba(190, 220, 255, 0.07));
  transition:
    background-color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

#address:focus-within {
  background: light-dark(#fff, #0b1321);
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent);
}

#address-icon {
  color: var(--ink-soft);
}

#url {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

#url::placeholder,
#home-q::placeholder {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Page area: a rounded card set into the frame                       */
/* ------------------------------------------------------------------ */

#content {
  position: relative;
  margin: 0 7px 7px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--page);
  box-shadow:
    0 0 0 1px var(--stroke),
    0 10px 30px -12px var(--shadow);
}

.view {
  position: absolute;
  inset: 0;
  overflow: auto;
}

/* New tab */
#view-home {
  display: flex;
  flex-direction: column;
  --base: light-dark(#eaf2fa, #070d18);
  background: var(--base);
}

.backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop i {
  position: absolute;
  border-radius: 50%;
}

.d1 {
  width: 90vmax;
  height: 90vmax;
  left: -30vmax;
  top: -48vmax;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 46%, transparent), transparent);
  animation: drift-a 46s ease-in-out infinite alternate;
}

.d2 {
  width: 80vmax;
  height: 80vmax;
  right: -32vmax;
  top: -20vmax;
  background: radial-gradient(closest-side, light-dark(rgba(120, 225, 255, 0.55), rgba(40, 150, 200, 0.3)), transparent);
  animation: drift-b 58s ease-in-out infinite alternate;
}

.d3 {
  width: 100vmax;
  height: 100vmax;
  left: 10vmax;
  bottom: -72vmax;
  background: radial-gradient(closest-side, light-dark(rgba(190, 200, 255, 0.7), rgba(80, 70, 190, 0.26)), transparent);
  animation: drift-c 70s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate(14vmax, 9vmax) scale(1.12);
  }
}
@keyframes drift-b {
  to {
    transform: translate(-12vmax, 12vmax) scale(0.92);
  }
}
@keyframes drift-c {
  to {
    transform: translate(-10vmax, -10vmax) scale(1.08);
  }
}

body[data-bg="midnight"] #view-home {
  color-scheme: dark;
  --base: #050914;
}
body[data-bg="midnight"] .d2,
body[data-bg="midnight"] .d3 {
  opacity: 0.55;
}

body[data-bg="dusk"] #view-home {
  color-scheme: dark;
  background: linear-gradient(165deg, #22215c 0%, #4a2f7a 42%, #a14f86 74%, #ee8d7c 100%);
}
body[data-bg="dusk"] .backdrop i {
  opacity: 0.3;
}

body[data-bg="polar"] #view-home {
  color-scheme: dark;
  --base: #03101a;
}
body[data-bg="polar"] .d1 {
  background: radial-gradient(closest-side, rgba(50, 230, 165, 0.42), transparent);
}
body[data-bg="polar"] .d2 {
  background: radial-gradient(closest-side, rgba(60, 140, 255, 0.4), transparent);
}

body[data-bg="mist"] #view-home {
  --base: light-dark(#f3f6fa, #0c1119);
}
body[data-bg="mist"] .backdrop i {
  opacity: 0.25;
}

.stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 30px 20px 6vh;
  animation: rise 0.5s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

#clock {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(56px, 11vw, 124px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(to bottom, var(--ink) 30%, color-mix(in srgb, var(--accent) 55%, var(--ink)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#clock .meridiem {
  font-size: 0.24em;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-inline-start: 0.35em;
}

#greeting {
  margin: -16px 0 0;
  font-size: 16px;
  color: var(--ink-soft);
}

#home-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(640px, 100%);
  height: 54px;
  padding: 0 8px 0 20px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--edge);
  box-shadow:
    0 1px 0 var(--edge) inset,
    0 14px 40px -12px var(--shadow);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  transition:
    box-shadow 0.18s var(--ease),
    transform 0.18s var(--ease);
}

#home-search > svg {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
}

#home-search:focus-within {
  background: var(--glass-strong);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent),
    0 18px 46px -12px var(--shadow);
  transform: translateY(-1px);
}

#home-q {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}

#home-search button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

#home-search button:hover {
  filter: brightness(1.1);
}

#tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(820px, 100%);
}

#tiles button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 104px;
  padding: 16px 8px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.18s var(--ease);
}

#tiles button:hover {
  background: var(--glass);
  border-color: var(--edge);
  transform: translateY(-2px);
}

#tiles .icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

#tiles .label {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
}

.note {
  position: relative;
  margin: 0;
  padding: 0 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

.note a {
  color: var(--accent);
  font-weight: 600;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* Search results */
#view-search {
  background:
    radial-gradient(60% 260px at 12% -60px, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), var(--page);
}

.results-wrap {
  width: min(760px, 100%);
  margin-inline-start: max(16px, calc((100% - 1100px) / 2 + 120px));
  padding: 18px 16px 60px 0;
}

#status {
  min-height: 20px;
  margin: 6px 16px 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

#status.error {
  color: light-dark(#c0303e, #ff8b96);
}

#results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  animation: rise 0.3s var(--ease) both;
}

.result:hover {
  background: var(--card);
  border-color: var(--stroke);
}

.result .site {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.result .chip {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.result .crumb {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.result .crumb b {
  font-weight: 500;
  color: var(--ink);
}

.result a {
  font-size: 18.5px;
  line-height: 1.3;
  color: var(--link);
  text-decoration: none;
}

.result a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

#results-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 16px 0;
}

.soft,
.primary {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--stroke);
  background: var(--card);
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
}

.soft:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
}

.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.primary:hover {
  filter: brightness(1.08);
}

/* Web pages */
#view-frame {
  overflow: hidden;
  background: #fff;
}

#frames,
#frames iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#frames iframe {
  background: #fff;
}

#blocked {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(60% 300px at 50% -60px, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), var(--page);
}

#blocked h2 {
  margin: 14px 0 0;
  max-width: 24ch;
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

#blocked p {
  max-width: 46ch;
  margin: 6px 0 14px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

#frame-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: light-dark(rgba(255, 255, 255, 0.92), rgba(16, 24, 42, 0.92));
  box-shadow:
    0 0 0 1px var(--stroke),
    0 10px 30px -10px var(--shadow);
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: center;
}

#frame-hint a {
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Customize                                                          */
/* ------------------------------------------------------------------ */

#panel {
  position: fixed;
  z-index: 5;
  top: 92px;
  right: 16px;
  width: min(300px, calc(100vw - 32px));
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid var(--edge);
  box-shadow: 0 30px 80px -20px var(--shadow);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  animation: rise 0.22s var(--ease) both;
}

#panel h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

#panel h3 {
  margin: 16px 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.16s var(--ease);
}

.swatch.bg {
  border-radius: 9px;
  width: 44px;
  box-shadow: inset 0 0 0 1px var(--stroke);
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch[aria-checked="true"] {
  box-shadow:
    0 0 0 2px light-dark(#fff, #16223a),
    0 0 0 4px var(--accent);
}

.hint {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/* Small screens, motion                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
  #get span {
    display: none;
  }
  #get {
    padding: 0 10px;
  }
  #mark,
  #home,
  #reload {
    display: none;
  }
  .tab {
    flex-basis: 150px;
  }
  #content {
    margin: 0 4px 4px;
  }
  .results-wrap {
    margin-inline-start: 0;
    padding-inline-end: 0;
  }
  #tiles button {
    width: 88px;
  }
}

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