:root {
  --bg-1: #f6efe6;
  --bg-2: #d9e4f2;
  --ink: #1b2430;
  --muted: #5c6b7a;
  --accent: #ff6b4a;
  --accent-soft: #ffb58f;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --stroke: rgba(27, 36, 48, 0.12);
  --shadow: 0 20px 60px rgba(27, 36, 48, 0.18);
  --radius: 22px;
  --blur: blur(18px);
  --pill-bg: #1b2430;
  --pill-fg: #ffffff;
  --terminal-bg: #0f1f2a;
  --terminal-fg: #e6f0f8;
  --calc-key: #ffffff;
  --calc-key-text: var(--ink);
  --calc-utility: rgba(27, 36, 48, 0.08);
  --calc-operator: rgba(255, 107, 74, 0.18);
  --calc-equals: var(--ink);
  --calc-equals-text: #ffffff;
  --graph-axis: rgba(27, 36, 48, 0.2);
  --graph-line: #ff6b4a;
  --graph-bg: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "SF Compact", "Google Sans Pro", "Google Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top left, var(--bg-1), var(--bg-2));
}

h1 {
  font-family: "SF Pro", "Google Sans Pro", "Google Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}

.small-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, var(--bg-1), var(--bg-2));
  color: var(--ink);
  font-family: "SF Pro", "Google Sans Pro", "Google Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  padding: 40px;
  text-align: center;
  align-content: center;
  z-index: 1000;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.4), transparent 55%);
  pointer-events: none;
}

body.theme-dark {
  --bg-1: #0f1520;
  --bg-2: #101a26;
  --ink: #eef1f6;
  --muted: #a9b5c6;
  --accent: #ff8a5b;
  --accent-soft: #ffc29a;
  --surface: rgba(18, 26, 38, 0.72);
  --surface-strong: rgba(24, 34, 48, 0.86);
  --surface-solid: #121a26;
  --glass: rgba(18, 26, 38, 0.72);
  --glass-strong: rgba(24, 34, 48, 0.86);
  --stroke: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --pill-bg: #1d2836;
  --pill-fg: #f4f7fb;
  --terminal-bg: #0b111a;
  --terminal-fg: #e6f0f8;
  --calc-key: #141e2a;
  --calc-key-text: #f4f7fb;
  --calc-utility: rgba(255, 255, 255, 0.12);
  --calc-operator: rgba(255, 138, 91, 0.24);
  --calc-equals: #ff8a5b;
  --calc-equals-text: #1b2430;
  --graph-axis: rgba(255, 255, 255, 0.2);
  --graph-line: #ffb38f;
  --graph-bg: rgba(18, 26, 38, 0.7);
}

body.theme-dark::before {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), transparent 55%);
}

.boot-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #ffffff, #e6eef7);
  display: grid;
  place-items: center;
  z-index: 999;
  animation: bootFade 0.8s ease 1.4s forwards;
}

body.theme-dark .boot-screen {
  background: radial-gradient(circle at center, #1a2330, #0c111b);
}

.boot-card {
  background: var(--glass-strong);
  padding: 32px 40px;
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 320px;
}

.boot-logo {
  font-family: "SF Pro", "Google Sans Pro", "Google Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 32px;
  letter-spacing: 0.5px;
}

.boot-sub {
  margin-top: 8px;
  color: var(--muted);
}

.boot-bar {
  height: 6px;
  background: rgba(27, 36, 48, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 18px;
}

.boot-bar span {
  display: block;
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  animation: bootLoad 1.2s ease-in-out infinite;
}

.desktop {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.menu-bar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  z-index: 20;
}

.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-pill {
  background: var(--pill-bg);
  color: var(--pill-fg);
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
}

.menu-ghost {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #38c682;
  box-shadow: 0 0 10px rgba(56, 198, 130, 0.6);
}

.status-text,
.status-time {
  font-size: 13px;
  color: var(--muted);
}

.control-toggle {
  border: 1px solid var(--stroke);
  background: var(--surface-solid);
  padding: 6px 12px;
  border-radius: 12px;
  color: var(--ink);
}

.control-center {
  position: absolute;
  top: 62px;
  right: 20px;
  width: 320px;
  background: var(--surface-strong);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 18px;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 30;
}

.control-center.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.control-header {
  font-weight: 600;
  margin-bottom: 12px;
}

.control-grid {
  display: grid;
  gap: 12px;
}

.control-card {
  background: var(--surface-solid);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--stroke);
}

.control-title {
  font-weight: 600;
}

.control-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.control-select {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  font-family: inherit;
}

.workspace {
  position: relative;
  height: calc(100vh - 52px);
  padding: 24px;
}

.window {
  position: absolute;
  left: var(--x, 10%);
  top: var(--y, 10%);
  width: min(540px, 82vw);
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  overflow: hidden;
  animation: riseIn 0.6s ease;
}

.window__resize {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border-right: 2px solid rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid rgba(0, 0, 0, 0.25);
  opacity: 0.45;
  cursor: se-resize;
}

body.theme-dark .window__resize {
  border-right-color: rgba(255, 255, 255, 0.45);
  border-bottom-color: rgba(255, 255, 255, 0.45);
}

.window.is-maximized {
  left: 8px;
  top: 56px;
  width: calc(100% - 16px);
  height: calc(100vh - 56px - 80px);
}

.window.is-maximized .window__content {
  max-height: calc(100% - 52px);
  overflow: auto;
}

.window.is-fullscreen {
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.window.is-fullscreen .window__content {
  max-height: calc(100% - 52px);
  overflow: auto;
}

.window.is-fullscreen .window__resize {
  display: none;
}

.window.is-hidden {
  display: none;
}

.window__titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--stroke);
  cursor: grab;
}

.window__title {
  font-weight: 600;
}

.window__traffic {
  display: flex;
  gap: 6px;
}

.traffic {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: #d1d6de;
}

.traffic.red {
  background: #ff5f56;
}

.traffic.yellow {
  background: #ffbd2e;
}

.traffic.green {
  background: #27c93f;
}

.window__content {
  padding: 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.deoxy-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.deoxy-title {
  font-family: "SF Pro", "Google Sans Pro", "Google Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
}

.deoxy-copy {
  margin-top: 6px;
  color: var(--muted);
}

.deoxy-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.field {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  margin-top: 6px;
  font-family: inherit;
}

.selector {
  cursor: pointer;
}

.pill {
  margin-top: 6px;
  background: rgba(255, 107, 74, 0.12);
  color: #8f3d2c;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
}

body.theme-dark .pill {
  background: rgba(255, 138, 91, 0.18);
  color: #ffd1b3;
}

.deoxy-logs {
  margin-top: 20px;
  background: var(--surface-solid);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  padding: 12px;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
}

.logs-body {
  margin-top: 10px;
  background: var(--terminal-bg);
  color: var(--terminal-fg);
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  min-height: 96px;
  overflow: auto;
  white-space: pre-wrap;
}

.ghost {
  border: 1px solid transparent;
  background: rgba(27, 36, 48, 0.08);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink);
}

body.theme-dark .ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.browser-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.primary {
  border: none;
  background: var(--ink);
  color: var(--surface-solid);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}


.browser-panel {
  margin-top: 14px;
  background: var(--surface-solid);
  border-radius: 16px;
  border: 1px solid var(--stroke);
  padding: 14px;
}

.browser-frame {
  width: 100%;
  min-height: 360px;
  height: 100%;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: var(--surface-solid);
}

.window[data-app="duckduckgo"] .window__content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.window[data-app="duckduckgo"] .browser-frame {
  flex: 1;
  min-height: 0;
}

.browser-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.browser-status {
  font-weight: 600;
}

.browser-output {
  margin-top: 8px;
  color: var(--muted);
  min-height: 60px;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: var(--surface-solid);
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 12px;
}

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

.metric-value {
  font-size: 18px;
  margin-top: 6px;
  font-weight: 600;
}

.monitor-note {
  margin-top: 12px;
  color: var(--muted);
}

.experience-header {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}

.experiences-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 17.5px;
  justify-content: center;
}

.experience-card {
  display: flex;
  flex-direction: column;
  gap: 7.5px;
  justify-self: center;
  align-items: center;
}

.experience-logo {
  display: flex;
  width: 100px;
  height: 100px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--surface-solid);
  box-shadow: 0 10px 24px rgba(15, 25, 36, 0.12);
  align-items: center;
  justify-content: center;
}

.experience-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.experience-subtitle {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.experience-subtitle:hover {
  text-decoration: underline;
}

.notes {
  width: 100%;
  min-height: 180px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 12px;
  font-family: -apple-system, "SF Compact", "Google Sans Pro", "Google Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--surface-solid);
  color: var(--ink);
}

.window--calc {
  width: min(560px, 92vw);
}

.calculator {
  display: grid;
  gap: 14px;
}

.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calc-tab {
  border: 1px solid var(--stroke);
  background: var(--surface-solid);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.calc-tab.is-active {
  background: var(--ink);
  color: var(--surface-solid);
}

.calc-display {
  background: var(--terminal-bg);
  color: var(--terminal-fg);
  border-radius: 16px;
  padding: 14px;
  text-align: right;
  min-height: 84px;
  display: grid;
  align-content: center;
}

.calc-expression {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.calc-result {
  font-size: 32px;
  font-weight: 600;
  margin-top: 6px;
}

.calc-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.calc-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.calculator[data-mode="graph"] .calc-input-row,
.calculator[data-mode="convert"] .calc-input-row,
.calculator[data-mode="settings"] .calc-input-row {
  display: none;
}

.calc-panels {
  display: grid;
}

.calc-panel {
  display: none;
}

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

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.calc-grid--scientific {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.calc-key {
  border: 1px solid var(--stroke);
  background: var(--calc-key);
  color: var(--calc-key-text);
  border-radius: 14px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.calc-key.is-utility {
  background: var(--calc-utility);
}

.calc-key.is-operator {
  background: var(--calc-operator);
  color: #8f3d2c;
}

body.theme-dark .calc-key.is-operator {
  color: #ffd1b3;
}

.calc-key.is-fn {
  font-size: 13px;
}

.calc-key.is-equals {
  background: var(--calc-equals);
  color: var(--calc-equals-text);
}

.calc-key.is-wide {
  grid-column: span 2;
}

.graph-form {
  display: grid;
  gap: 10px;
}

.graph-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.graph-canvas {
  background: var(--graph-bg);
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 8px;
}

.graph-canvas svg {
  width: 100%;
  height: 220px;
}

.graph-canvas svg .graph-axis {
  stroke: var(--graph-axis);
  stroke-width: 1;
}

.graph-canvas svg .graph-line {
  fill: none;
  stroke: var(--graph-line);
  stroke-width: 2;
}


.graph-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.convert-row {
  display: grid;
  gap: 6px;
}

.convert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.convert-output {
  background: var(--surface-solid);
  border-radius: 12px;
  border: 1px solid var(--stroke);
  padding: 10px 12px;
  font-weight: 600;
}

.convert-rate {
  margin-top: 10px;
}

.convert-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  gap: 12px;
}

.settings-card {
  background: var(--surface-solid);
  border-radius: 14px;
  border: 1px solid var(--stroke);
  padding: 12px;
}

.settings-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  overflow: hidden;
}

.segmented__button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.segmented__button.is-active {
  background: var(--ink);
  color: var(--surface-solid);
}

.dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px 18px;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--stroke);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}

.dock__button {
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}

.dock__icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-solid);
  display: grid;
  place-items: center;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(27, 36, 48, 0.15);
  color: var(--ink);
}

.dock__label {
  font-size: 11px;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-block;
  --switch-w: 48px;
  --switch-h: 26px;
  --switch-pad: 2px;
  --knob: 22px;
  width: var(--switch-w);
  height: var(--switch-h);
  min-width: var(--switch-w);
  min-height: var(--switch-h);
  flex: 0 0 auto;
  margin-top: 10px;
}

.switch.large {
  --switch-w: 64px;
  --switch-h: 34px;
  --switch-pad: 3px;
  --knob: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--pill-bg);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: var(--knob);
  width: var(--knob);
  left: var(--switch-pad);
  top: calc((var(--switch-h) - var(--knob)) / 2);
  background: var(--pill-fg);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
}

.switch input:checked + .slider::before {
  left: calc(100% - var(--knob) - var(--switch-pad));
}

.deoxy-off .status-dot {
  background: #ff9250;
  box-shadow: 0 0 10px rgba(255, 146, 80, 0.6);
}

.deoxy-off .status-text {
  color: #8a4a2d;
}

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

@keyframes bootLoad {
  0% {
    transform: translateX(-40%);
  }
  50% {
    transform: translateX(10%);
  }
  100% {
    transform: translateX(140%);
  }
}

@keyframes bootFade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

  .workspace {
    height: auto;
    padding-bottom: 120px;
  }

  .window {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    margin-bottom: 20px;
  }

  .dock {
    position: fixed;
  }

  .small-screen {
    display: grid;
  }

  .desktop {
    display: none;
  }
}

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