/* Nyoki Marketing — minimal, readable, responsive */
:root {
  --bg: #fbfaf6;
  --fg: #1d1d1b;
  --muted: #5b5b57;
  --accent: #6b8e4e;
  --border: #e7e4d9;
  --code-bg: #f1eee3;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --fg: #ece9dc;
    --muted: #9c9b8e;
    --accent: #a8c98a;
    --border: #2c2b25;
    --code-bg: #232218;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", "Apple Garamond", Georgia, "Songti TC",
               "PingFang TC", "Noto Serif CJK TC", serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.site-header,
.site-footer,
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
}

.site-header .brand img {
  width: 28px;
  height: 28px;
}

.site-header nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-header nav a:hover { color: var(--fg); }

main { padding-bottom: 4rem; }

h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: 1rem 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }

p, li { color: var(--fg); }
small, .meta { color: var(--muted); font-size: 0.9rem; }

ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }

code, pre {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

pre {
  padding: 0.75rem 1rem;
  overflow-x: auto;
}

.lang-switch {
  display: inline-flex;
  gap: 0.5rem;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.9rem;
}

.lang-switch a {
  text-decoration: none;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}
.lang-switch a.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th { background: var(--code-bg); }

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-footer a { color: var(--muted); }

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 { font-size: 2.6rem; margin-bottom: 0.5rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); }

.cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
.cta.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  margin-left: 0.5rem;
}

@media (max-width: 540px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.6rem; }
}

/* Contact form */
.contact-form {
  margin: 1.5rem 0 2rem;
}

.contact-fieldset {
  margin: 0;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.contact-fieldset > legend {
  padding: 0 0.6rem;
  margin-left: -0.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.contact-form .form-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: start;
  column-gap: 1rem;
  row-gap: 0.35rem;
  margin-bottom: 1rem;
}

.contact-form .form-row--block {
  grid-template-columns: 1fr;
  row-gap: 0.4rem;
}

.contact-form .form-row--block label {
  padding-top: 0;
}

.contact-form label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  padding-top: 0.55rem;
}

.contact-form .req { color: #c0392b; margin-left: 0.15rem; }

.contact-form .form-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 6em;
  line-height: 1.5;
  font-family: inherit;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 142, 78, 0.18);
}

.contact-form .hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.contact-form .form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.contact-form button.cta {
  margin: 0;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
}

.contact-form button.cta:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form-status {
  font-size: 0.9rem;
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

.form-status.is-success { color: var(--accent); font-weight: 600; }
.form-status.is-error { color: #c0392b; font-weight: 600; }

@media (max-width: 600px) {
  .contact-fieldset {
    padding: 1.25rem 1.1rem 1rem;
  }
  .contact-form .form-row {
    grid-template-columns: 1fr;
    row-gap: 0.4rem;
  }
  .contact-form label {
    padding-top: 0;
  }
  .contact-form .form-actions {
    justify-content: stretch;
  }
  .contact-form .form-actions .form-status {
    order: 2;
    text-align: center;
    flex-basis: 100%;
  }
  .contact-form button.cta {
    flex: 1;
    order: 1;
  }
}
