/* Coconut website styles */

:root {
  --brand-1: #155799;
  --brand-2: #159957;
  --text: #24292f;
  --muted: #57606a;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
  --output-bg: #eef6f1;
  --output-text: #1a4d2e;
  --link: #0e6bb8;
  --accent: #159957;
  --shadow: 0 1px 3px rgba(31, 35, 40, 0.08), 0 6px 18px rgba(31, 35, 40, 0.06);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Open Sans", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e6edf3;
    --muted: #9da7b3;
    --bg: #0d1117;
    --bg-alt: #151b23;
    --border: #30363d;
    --code-bg: #161b22;
    --output-bg: #12261c;
    --output-text: #a7e3bd;
    --link: #58a6ff;
    --accent: #3fb950;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre, textarea { font-family: var(--mono); font-size: 0.88em; }

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

kbd {
  padding: 0.1em 0.4em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-alt);
}

/* hero */

.hero {
  color: #fff;
  background-color: var(--brand-2);
  background-image: linear-gradient(120deg, var(--brand-1), var(--brand-2));
  padding: 0 1rem 3.5rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
}

.top-nav a { color: rgba(255, 255, 255, 0.85); font-weight: 500; }
.top-nav a:hover { color: #fff; }

.hero-body {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: 1100px;
  margin: 1.5rem auto 0;
}

.logo {
  width: 180px;
  height: auto;
  flex: none;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
}

.hero h1 { font-size: 3.5rem; line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
.tagline { font-size: 1.5rem; margin: 0.4rem 0 1rem; opacity: 0.9; }
.intro { max-width: 46rem; margin: 0 0 1.5rem; opacity: 0.95; }
.intro strong { color: #fff; }

.install {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 1.25rem;
}

.install code { background: none; border: none; color: #fff; font-size: 1.05rem; padding: 0; }
.install code::before { content: "$ "; opacity: 0.6; }

.copy {
  font: inherit;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
}

.copy:hover { background: rgba(255, 255, 255, 0.25); }

.hero-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.btn:hover { background: rgba(255, 255, 255, 0.2); text-decoration: none; }
.btn.primary { background: #fff; color: var(--brand-1); border-color: #fff; }
.btn.primary:hover { background: #eef6ff; }

/* sections */

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1rem 1rem;
}

.section h2 { font-size: 2rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.section-intro { color: var(--muted); margin-top: 0; }

pre {
  margin: 0;
  overflow-x: auto;
  line-height: 1.5;
}

pre.code {
  padding: 1rem 1.1rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

pre.output {
  padding: 0.6rem 1.1rem;
  background: var(--output-bg);
  color: var(--output-text);
  border-radius: var(--radius);
  white-space: pre-wrap;
}

/* playground */

.playground {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--bg);
}

.playground-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.2rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.playground-toolbar select {
  font: inherit;
  margin-left: 0.4rem;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  max-width: 16rem;
}

.toggle { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.status { color: var(--muted); flex: 1; min-width: 10rem; }
.status.error { color: #cf222e; }

.playground-toolbar .btn.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  padding: 0.35rem 1.2rem;
}

.playground-toolbar .btn.primary:disabled { opacity: 0.5; cursor: progress; }

.playground-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 24rem;
}

#editor {
  width: 100%;
  min-height: 24rem;
  resize: vertical;
  border: none;
  border-right: 1px solid var(--border);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  tab-size: 4;
  outline: none;
}

.playground-output {
  padding: 1rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--code-bg);
  color: var(--text);
}

.playground-output .stderr { color: #cf222e; }
.playground-output .note { color: var(--muted); font-style: italic; }

@media (prefers-color-scheme: dark) {
  .playground-output .stderr, .status.error { color: #ff7b72; }
}

/* features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  min-width: 0;
}

.feature h3 { margin: 0; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.feature pre.code { flex: 1; font-size: 0.85rem; }

.feature-footer { display: flex; align-items: flex-start; gap: 0.75rem; }
.feature-footer pre.output { flex: 1; font-size: 0.82rem; }

.try-it {
  flex: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  cursor: pointer;
}

.try-it:hover { color: #fff; background: var(--accent); }

.more { margin-top: 1.5rem; }

/* other sections */

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.two-col p:first-child { margin-top: 0; }

.lead { font-size: 1.2rem; }

.install-steps {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.install-steps p:first-child { margin-top: 0; }
.install-steps p:last-child { margin-bottom: 0; }
.install-steps ol { margin: 0.25rem 0 1rem; padding-left: 1.5rem; }
.install-steps .install { background: var(--bg); border-color: var(--border); margin-bottom: 0; }
.install-steps .install code { color: var(--text); }
.install-steps .copy { color: var(--text); background: var(--bg-alt); border-color: var(--border); }
.install-steps .copy:hover { background: var(--border); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.card p { margin: 0 0 0.75rem; font-size: 0.95rem; }
.card pre.output { font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.links { padding-left: 1.2rem; }
.links li { margin: 0.4rem 0; }

.site-footer {
  max-width: 1100px;
  margin: 3rem auto 0;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* small screens */

@media (max-width: 800px) {
  body { font-size: 16px; }
  .hero-body { flex-direction: column; text-align: center; gap: 1.5rem; }
  .hero-buttons, .install { justify-content: center; }
  .logo { width: 120px; }
  .hero h1 { font-size: 2.6rem; }
  .tagline { font-size: 1.2rem; }
  .top-nav { justify-content: center; }
  .playground-panes, .two-col { grid-template-columns: 1fr; }
  #editor { border-right: none; border-bottom: 1px solid var(--border); }
  .features { grid-template-columns: 1fr; }
  .feature-footer { flex-direction: column; align-items: stretch; }
}
