/* yuan1182.org v3 — editor/industrial design */

:root {
  --bg: #FAF9F5;
  --panel: #FFFFFF;
  --panel-2: #F3F1EB;
  --text: #1A1917;
  --text-2: #6B675F;
  --text-3: #8A867D;
  --line: #E5E2DA;
  --line-2: #D9D6CF;
  --accent: #C2410C;
  --accent-text: #FAF9F5;
  --radius: 2px;
  --max: 1200px;
  --gap: 48px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.mono {
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
}

.sans-heading {
  font-family: "Space Grotesk", "Inter", "Noto Sans SC", sans-serif;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.logo-text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 32px;
  flex: 1;
}

.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-cta {
  background: var(--text);
  color: var(--accent-text);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.nav-cta:hover {
  background: var(--accent);
  text-decoration: none;
}

/* Section meta */
.section-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-2);
}

.section-meta .idx {
  color: var(--accent);
  letter-spacing: 1px;
  font-weight: 500;
}

.section-meta .rule {
  width: 32px;
  height: 1px;
  background: var(--line-2);
}

/* Hero */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}

.hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 64px;
  line-height: 1.18;
  letter-spacing: -2px;
  font-weight: 700;
  margin: 0;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.66;
  color: var(--text-2);
  max-width: 560px;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: none;
}

.btn-primary {
  background: var(--text);
  color: var(--accent-text);
  border: 1px solid var(--text);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
}

.btn-secondary:hover {
  border-color: var(--text);
  text-decoration: none;
}

.hero-photo-wrap {
  width: 202px;
  padding-top: 38px;
  flex-shrink: 0;
}

.hero-photo {
  width: 202px;
  height: 202px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
}

/* Data bar */
.data-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}

.data-item {
  padding: 16px 24px;
  border-right: 1px solid var(--line);
}

.data-item:last-child {
  border-right: none;
}

.data-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.data-value {
  font-size: 15px;
  font-weight: 500;
  margin-top: 4px;
}

/* Sections */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 40px;
  line-height: 1.3;
  letter-spacing: -1px;
  font-weight: 700;
  margin: 0 0 16px;
}

.section-desc {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-2);
  max-width: 640px;
  margin: 0;
}

/* About */
.about-head {
  font-family: "Space Grotesk", sans-serif;
  font-size: 32px;
  line-height: 1.375;
  letter-spacing: -1px;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 720px;
}

.about-body {
  font-size: 16px;
  line-height: 1.875;
  color: var(--text-2);
  max-width: 720px;
  margin: 0;
}

/* Bento */
.bento-grid {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  margin-top: 24px;
}

.bento-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border-bottom: 1px solid var(--line);
}

.bento-row:last-child {
  border-bottom: none;
}

.bento-row-alt {
  grid-template-columns: 1fr 1fr 2fr;
}

.bento-cell {
  padding: 28px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bento-cell:last-child {
  border-right: none;
}

.bento-cell.tint {
  background: var(--panel-2);
}

.bento-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.bento-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-weight: 700;
  margin: 0;
}

.bento-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0;
}

.bento-row-alt .bento-cell {
  padding: 24px;
}

.bento-row-alt .bento-title {
  font-size: 20px;
}

.bento-row-alt .bento-desc {
  font-size: 13px;
  line-height: 1.68;
}

/* List rows */
.list {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

a.list-row {
  color: var(--text);
  text-decoration: none;
}

a.list-row:hover {
  background: var(--panel-2);
  text-decoration: none;
}

a.list-row:hover .list-label {
  color: var(--accent);
}

.list-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text);
}

.list-label {
  flex: 0 0 240px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: none;
}

.links-list .list-label {
  flex-basis: 280px;
}

.favicon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 12px;
  vertical-align: -2px;
  border-radius: 2px;
  object-fit: cover;
}

.list-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text-2);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-value a {
  color: var(--text-2);
  text-decoration: none;
}

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

/* Guestbook */
.quote {
  background: var(--panel-2);
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-top: 24px;
}

.quote-text {
  font-size: 15px;
  color: var(--text);
  margin: 0 0 8px;
}

.quote-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-3);
}

.form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
}

.field input,
.field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--text);
}

.field textarea {
  resize: vertical;
  min-height: 96px;
}

/* Page header */
.page-header {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--line);
}

/* QSL page */
.qsl-body {
  padding: 48px 0 72px;
  border-bottom: 1px solid var(--line);
}

.qsl-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 48px;
  align-items: start;
}

.qsl-card {
  width: 100%;
  aspect-ratio: 400 / 260;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: block;
}

.qsl-card-caption {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 12px;
}

.qsl-info-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  font-weight: 700;
  margin: 0 0 12px;
}

.qsl-info {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-2);
  margin: 0 0 24px;
  white-space: pre-line;
}

/* Apply form page */
.apply-form {
  padding: 48px 0 72px;
  border-bottom: 1px solid var(--line);
}

.apply-inner {
  max-width: 720px;
}

/* Admin records */
.records {
  padding: 48px 0 72px;
  border-bottom: 1px solid var(--line);
}

.record {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: none;
  background: var(--panel);
}

.record:first-child {
  border-top: 1px solid var(--line);
}

.record-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.record-callsign {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}

.record-tag {
  background: var(--panel-2);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-2);
}

.record-detail {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.68;
}

/* Links */
.links-list {
  padding: 48px 0 72px;
  border-bottom: 1px solid var(--line);
}

/* Footer */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.footer-inner {
  padding: 24px 0;
}

.footer-top {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-callsign {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
  font-weight: 500;
}

.footer-email {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-2);
}

.footer-bottom {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: var(--text-3);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column-reverse;
    gap: 32px;
  }

  .hero-photo-wrap {
    padding-top: 0;
  }

  .hero-title {
    font-size: 42px;
    letter-spacing: -1px;
  }

  .data-bar {
    grid-template-columns: 1fr 1fr;
  }

  .data-item:nth-child(2) {
    border-right: none;
  }

  .data-item:nth-child(1),
  .data-item:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .bento-row,
  .bento-row-alt {
    grid-template-columns: 1fr;
  }

  .bento-cell {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .bento-cell:last-child {
    border-bottom: none;
  }

  .qsl-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 32px;
  }

  .section-title {
    font-size: 28px;
  }

  .data-bar {
    grid-template-columns: 1fr;
  }

  .data-item {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .data-item:last-child {
    border-bottom: none;
  }

  .list-row {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 6px 12px;
  }

  .list-label {
    flex: 0 0 auto;
    width: auto;
  }

  .list-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .list-label,
  .links-list .list-label {
    flex-basis: auto;
    width: auto;
  }
}

/* Form backend status + Turnstile */
.form .cf-turnstile + .btn {
  margin-top: 0;
}

.form-status {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  min-height: 1.5em;
}

.form-status.is-error {
  color: #C2410C;
}

.record-actions {
  margin-top: 12px;
}

.form .cf-turnstile {
  align-self: flex-start;
}

.logo-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
  flex-shrink: 0;
}
