:root {
  --bg: #a58d96;
  --bg-dark: #927983;
  --surface: #806d76;
  --surface-soft: #927d87;
  --white: #ffffff;
  --text: #ffffff;
  --muted: #eee2e6;
  --accent: #f7dce5;
  --line: rgba(255,255,255,0.23);
  --editor: #272326;
  --editor-text: #f4eaf0;
  --shadow: 0 20px 55px rgba(52,35,43,0.13);
}

body.light-theme {
  --bg: #f4f1f2;
  --bg-dark: #e9e1e4;
  --surface: #ffffff;
  --surface-soft: #f4edef;
  --white: #252124;
  --text: #252124;
  --muted: #777078;
  --accent: #a58d96;
  --line: rgba(50,35,43,0.13);
  --editor: #282428;
  --editor-text: #f4eaf0;
  --shadow: 0 20px 55px rgba(30,20,25,0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
}

button {
  font: inherit;
  cursor: pointer;
}

.app {
  width: min(1200px, calc(100% - 48px));
  margin: auto;
}

/* NAVBAR */

.navbar {
  height: 82px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--bg);
  border-radius: 8px;
  font-weight: 800;
  font-size: 19px;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 5px;
}

.brand-label {
  font-size: 9px;
  letter-spacing: 2px;
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.online-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
}

.online-dot,
.studio-dot,
.preview-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9e4c8;
}

.theme-button {
  width: 39px;
  height: 39px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  font-size: 20px;
  transition: 0.25s;
}

.theme-button:hover {
  transform: rotate(30deg);
  background: var(--surface);
  color: var(--white);
}

/* HERO */

main {
  padding-top: 65px;
}

.hero-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-bottom: 20px;
}

.hero-tag span {
  height: 1px;
  width: 25px;
  background: currentColor;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
}

.hero h1 {
  font-size: clamp(44px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -3px;
  font-weight: 700;
}

.hero h1 span {
  font-family: "Allura", cursive;
  font-size: 1.25em;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
}

.hero p {
  max-width: 420px;
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.8;
  opacity: 0.85;
}

.hero-decoration {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.8;
  letter-spacing: 1px;
  opacity: 0.8;
}

.decoration-star {
  font-size: 42px;
  color: var(--accent);
}

/* STUDIO */

.studio {
  background: var(--surface);
  color: var(--white);
  padding: 25px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: appear 0.7s ease both;
}

.studio-top,
.studio-heading,
.studio-actions,
.auto-run,
.editor-heading,
.preview-heading,
.preview-indicator,
.studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-top {
  margin-bottom: 25px;
}

.studio-heading {
  justify-content: flex-start;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
}

.studio-dot {
  background: #8bb99b;
}

.studio-actions {
  gap: 20px;
}

.auto-run {
  justify-content: flex-start;
  gap: 8px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  cursor: pointer;
}

.auto-run input {
  accent-color: #a58d96;
}

.small-button,
.secondary-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--white);
  border-radius: 5px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 9px 12px;
  transition: 0.2s;
}

.small-button:hover,
.secondary-button:hover {
  background: var(--bg);
  color: white;
}

/* PANELS */

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.editor-heading,
.preview-heading {
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-number {
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  opacity: 0.65;
}

.editor-heading h2,
.preview-heading h2 {
  font-size: 18px;
  margin-top: 5px;
  font-weight: 700;
}

.editor-window {
  overflow: hidden;
  background: var(--editor);
  border-radius: 9px;
  color: var(--editor-text);
}

.editor-tabs {
  height: 46px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.editor-tab {
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: #bcb1b9;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  border-bottom: 2px solid transparent;
}

.editor-tab.active {
  color: white;
  border-bottom-color: #d6aeba;
  background: rgba(255,255,255,0.04);
}

.tab-icon {
  font-size: 10px;
  font-weight: 700;
}

.html-icon { color: #e79a80; }
.css-icon { color: #8ab9e5; }
.js-icon { color: #e6d58c; }

.editor-container {
  min-height: 390px;
}

.editor-container > textarea {
  display: none;
}

.CodeMirror {
  height: 390px;
  background: var(--editor);
  color: var(--editor-text);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.8;
}

.CodeMirror-gutters {
  background: var(--editor);
  border-right: 1px solid rgba(255,255,255,0.1);
}

.CodeMirror-linenumber {
  color: #837780;
  padding: 0 12px 0 7px;
}

.CodeMirror-cursor {
  border-left: 2px solid #e8bdca;
}

.CodeMirror-selected {
  background: rgba(214,174,186,0.22) !important;
}

.cm-keyword { color: #dba5c2 !important; }
.cm-string { color: #b6d5ae !important; }
.cm-number { color: #e7c48f !important; }
.cm-comment { color: #948a91 !important; }
.cm-tag { color: #e7a6a0 !important; }
.cm-attribute { color: #d9c18d !important; }
.cm-def { color: #a9c5df !important; }

.editor-bottom {
  display: flex;
  justify-content: space-between;
  padding: 11px 13px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #a99ca5;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
}

.editor-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.secondary-button {
  font-size: 8px;
}

/* PREVIEW */

.preview-indicator {
  gap: 7px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
}

.preview-indicator span {
  background: #8dbb9d;
}

.browser-window {
  background: #fff;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.1);
}

.browser-bar {
  height: 43px;
  padding: 0 12px;
  background: #f1edef;
  display: flex;
  align-items: center;
  gap: 12px;
}

.browser-dots {
  display: flex;
  gap: 5px;
}

.browser-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c7aeb8;
}

.browser-dots i:nth-child(2) {
  background: #d7c4cc;
}

.browser-dots i:nth-child(3) {
  background: #e8dce1;
}

.browser-address {
  flex: 1;
  background: #fff;
  border-radius: 4px;
  padding: 6px;
  text-align: center;
  color: #9b8b93;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.browser-bar button {
  border: none;
  background: transparent;
  color: #796b72;
  font-size: 19px;
}

#previewFrame {
  display: block;
  width: 100%;
  height: 390px;
  border: none;
  background: #fff;
}

.run-button {
  width: 100%;
  margin-top: 13px;
  padding: 14px 16px;
  border: none;
  border-radius: 6px;
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  transition: 0.25s;
}

.run-button:hover {
  background: #806b75;
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(70,45,57,0.18);
}

.run-arrow {
  font-size: 16px;
}

.preview-note {
  font-size: 10px;
  opacity: 0.65;
  margin-top: 10px;
}

/* FOOTER */

.studio-footer {
  border-top: 1px solid var(--line);
  margin-top: 25px;
  padding-top: 17px;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 1px;
  opacity: 0.65;
}

.bottom-message {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 27px 0 45px;
}

.message-star {
  font-size: 22px;
  color: var(--accent);
}

.bottom-message p {
  font-family: "Allura", cursive;
  font-size: 27px;
}

.footer {
  height: 70px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 1px;
  opacity: 0.8;
}

.footer-mark {
  color: var(--accent);
}

/* ANIMATION */

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button,
.studio,
.editor-window,
.browser-window {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* RESPONSIVE */

@media (max-width: 850px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .hero-decoration {
    display: none;
  }
}

@media (max-width: 600px) {
  .app {
    width: calc(100% - 26px);
  }

  .navbar {
    height: 70px;
  }

  .brand-label,
  .brand-divider,
  .online-label {
    display: none;
  }

  main {
    padding-top: 45px;
  }

  .hero-content {
    margin-bottom: 30px;
  }

  .hero h1 {
    font-size: 49px;
    letter-spacing: -2px;
  }

  .hero p {
    font-size: 12px;
  }

  .studio {
    padding: 14px;
  }

  .studio-actions {
    gap: 9px;
  }

  .auto-run {
    font-size: 8px;
  }

  .small-button {
    padding: 8px;
  }

  .editor-tab {
    padding: 0 9px;
    font-size: 8px;
  }

  .CodeMirror,
  #previewFrame {
    height: 330px;
  }

  .editor-container {
    min-height: 330px;
  }

  .editor-heading h2,
  .preview-heading h2 {
    font-size: 16px;
  }

  .studio-footer {
    font-size: 7px;
  }

  .bottom-message p {
    font-size: 23px;
  }

  .footer {
    font-size: 7px;
  }
}

@media (max-width: 370px) {
  .studio-heading {
    font-size: 8px;
  }

  .editor-tab {
    padding: 0 6px;
    gap: 4px;
    font-size: 7px;
  }

  .secondary-button {
    padding: 8px 6px;
    font-size: 7px;
  }
}