/* ============================================
   Chris Laycock — Console-inspired static site
   ============================================ */

/* ── Design tokens ── */
:root {
  --squid: #232f3e;
  --nav: #1b2530;
  --nav-hover: #2a3a4e;
  --orange: #ff9900;
  --orange-hover: #ec7211;
  --bg: #f2f3f3;
  --white: #ffffff;
  --text: #16191f;
  --muted: #545b64;
  --link: #0073bb;
  --border: #d5dbdb;
  --green: #1d8102;
  --focus-ring: 2px solid var(--link);
  --focus-offset: 2px;
}

/* ── Reset & base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--white);
  color: var(--link);
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* ── Top navigation ── */
.topbar {
  background: var(--nav);
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  font-size: 13px;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: -0.3px;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  margin-right: 4px;
  flex-shrink: 0;
  text-decoration: none;
  color: #fff;
}

.logo .cube {
  width: 14px;
  height: 14px;
  background: var(--orange);
  border-radius: 2px;
  margin-right: 3px;
}

.search-bar {
  flex: 1;
  max-width: 460px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  font-size: 12px;
  color: #8d9baa;
  cursor: pointer;
  transition: border-color 0.15s;
  font-family: inherit;
}

.search-bar:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.search-icon {
  width: 12px;
  height: 12px;
  border: 1.5px solid #8d9baa;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1.5px;
  background: #8d9baa;
  bottom: -3px;
  right: -4px;
  transform: rotate(45deg);
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-icon {
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  transition: background 0.1s;
  text-decoration: none;
  color: #d5dbdb;
}

.nav-icon:hover {
  background: var(--nav-hover);
  color: #fff;
}

.nav-icon svg {
  width: 14px;
  height: 14px;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

.region-sel,
.user-sel {
  font-size: 12px;
  color: #d5dbdb;
  padding: 4px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.region-sel {
  background: rgba(255, 255, 255, 0.06);
}

/* ── Breadcrumb ── */
.breadcrumb {
  background: var(--squid);
  padding: 8px 20px;
  font-size: 12px;
  color: #8d9baa;
}

.breadcrumb a {
  color: var(--link);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-current {
  color: #c5cbd3;
}

/* ── Shared page shell ── */
.page-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding-left: clamp(20px, 2.8vw, 32px);
  padding-right: clamp(20px, 2.8vw, 32px);
}

/* ── Service header ── */
.service-header {
  background: var(--white);
  border-bottom: 1px solid #e7eaef;
}

.service-header-inner {
  padding-top: 24px;
}

.sh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.sh-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sh-icon {
  width: 40px;
  height: 40px;
  background: var(--squid);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--orange);
  flex-shrink: 0;
}

.sh-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.sh-fav {
  color: #d5dbdb;
  font-size: 16px;
  cursor: pointer;
  margin-left: 6px;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0 2px;
  line-height: 1;
  font-family: inherit;
}

.sh-fav:hover {
  color: var(--orange);
}

.sh-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  padding-left: 52px;
  max-width: 760px;
  line-height: 1.6;
}

.sh-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-con {
  font-family: inherit;
  font-size: 13px;
  padding: 5px 16px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #aab7b8;
  background: var(--white);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.1s;
}

.btn-con:hover {
  background: #fafafa;
}

.btn-con.btn-primary {
  background: var(--orange);
  border-color: var(--orange-hover);
  color: #16191f;
  font-weight: 600;
}

.btn-con.btn-primary:hover {
  background: var(--orange-hover);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 0;
  margin-top: 22px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 9px 18px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.1s;
  user-select: none;
  font-family: inherit;
  background: none;
  border: none;
  border-radius: 0;
}

.tab[aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--text);
}

.tab:hover:not([aria-selected="true"]) {
  color: var(--text);
}

.tab:focus-visible {
  z-index: 1;
}

/* ── Tab panels ── */
.tabpanel[hidden] {
  display: none !important;
}

.detail-item.span-2 {
  grid-column: span 2;
}

/* ── Content area ── */
.content {
  padding-top: 24px;
  padding-bottom: 56px;
}

/* ── Panels ── */
.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(27, 37, 48, 0.04);
}

.panel-header {
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header-meta {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.panel-body {
  padding: 16px 20px;
}

.panel-body--flush {
  padding: 0;
}

.panel-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: #eef2f5;
  border: 1px solid #dde4ea;
  border-radius: 4px;
  padding: 1px 5px;
}

.tags-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.55;
}

.tag-row {
  margin-top: 4px;
}

.tag-row--large {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Detail grid ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 32px;
}

.detail-item label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 600;
}

.detail-item span {
  font-size: 14px;
  color: var(--text);
}

.detail-item a {
  color: var(--link);
  text-decoration: none;
}

.detail-item a:hover {
  text-decoration: underline;
}

.status-ok {
  color: var(--green);
  font-size: 14px;
}

.copyable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: background 0.1s;
}

.copy-btn svg {
  fill: var(--muted);
  width: 13px;
  height: 13px;
  transition: fill 0.1s;
}

.copy-btn:hover {
  background: var(--bg);
}

.copy-btn:hover svg {
  fill: var(--link);
}

.copy-btn.copied svg {
  fill: var(--green);
}

/* ── Tags ── */
.tag {
  display: inline-flex;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 2px 4px 2px 0;
}

.tag-key {
  background: #f2f3f3;
  padding: 2px 7px;
  color: var(--muted);
  border-right: 1px solid var(--border);
}

.tag-val {
  padding: 2px 7px;
  background: var(--white);
  color: var(--text);
}

/* ── Features table ── */
table.features {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.features th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

table.features td {
  padding: 10px 12px;
  border-bottom: 1px solid #eaeded;
  vertical-align: top;
}

table.features a {
  color: var(--link);
  text-decoration: none;
}

table.features a:hover {
  text-decoration: underline;
}

table.features tr:last-child td {
  border-bottom: none;
}

.feature-name {
  font-weight: 600;
}

.feature-desc {
  color: var(--text);
  line-height: 1.45;
}

.feature-status {
  font-size: 12px;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.feature-status--active {
  color: var(--link);
}

.feature-focus {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.feature-focus--primary {
  color: var(--link);
}

.feature-focus--core {
  color: var(--muted);
}

.feature-focus--practice {
  color: var(--text);
}

@media (min-width: 701px) {
  .features--timeline td:first-child {
    white-space: nowrap;
    width: 1%;
  }
}

/* ── Footer ── */
.footer-bar {
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-bar p {
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .topbar {
    padding: 0 10px;
  }

  .search-bar {
    display: none;
  }

  .nav-icons {
    margin-left: auto;
  }

  .breadcrumb {
    padding: 8px 14px;
  }

  .service-header {
    border-bottom: none;
  }

  .page-shell {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .service-header-inner {
    padding-top: 16px;
  }

  .sh-top {
    flex-direction: column;
    gap: 20px;
  }

  .sh-actions {
    margin-left: 52px;
    margin-top: 12px;
  }

  .sh-sub {
    padding-left: 52px;
    margin-left: 0;
  }

  .content {
    padding-top: 16px;
    padding-bottom: 32px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .detail-item.span-2 {
    grid-column: span 1;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 9px 14px;
    white-space: nowrap;
  }

  /* Stack feature rows instead of hiding the description column */
  table.features thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  table.features tbody tr {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }

  table.features tbody tr:last-child {
    border-bottom: none;
  }

  table.features td {
    display: block;
    padding: 4px 0;
    border: none;
  }

  table.features td.feature-name {
    font-weight: 700;
    font-size: 14px;
    padding-top: 0;
  }

  table.features td.feature-desc {
    color: var(--muted);
    font-size: 13px;
  }

  table.features td:last-child {
    padding-bottom: 0;
  }
}
