/* Design tokens: the whole look is tuned from here. Values come from
   Materials/photonamus-layout.html, which the human picked over the hub palette. */
:root {
  /* Charcoal surfaces, darkest to lightest */
  --bg:            #16171a;
  --surface:       #1e2024;
  --card:          #25282d;
  --card-hover:    #2c3036;

  --line:          #33363c;
  --line-strong:   #464a52;

  --text:          #e6e4df;
  --text-dim:      #a3a29d;
  --text-faint:    #6f6e6a;

  /* Gold is the frame and accent colour: dividers, active edges, tags, links */
  --gold:          #c9a24a;
  --gold-dim:      #8a7033;

  --radius:        6px;
  --rail-w:        220px;
  --topbar-h:      32px;
  --gap:           16px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Frame */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.brand span { color: var(--gold); }
.diamond { fill: none; stroke: var(--gold); }
.topbar-meta { font-size: 12px; color: var(--text-faint); }

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

.rail {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  display: flex; flex-direction: column;
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.rail-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-faint); padding: 0 10px; margin: 0 0 8px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: block;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active { color: var(--text); border-left-color: var(--gold); background: var(--card); }

/* Reserved slot at the bottom of the rail; hidden until it has content */
.rail-info {
  margin-top: auto;
  padding: 12px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12px; line-height: 1.7;
  color: var(--text-dim);
}
.rail-info:empty { display: none; }

.content {
  display: flex; flex-direction: column;
  padding: 28px 32px 24px;
}
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.page-head p { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }

.section + .section { margin-top: 40px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px; margin-bottom: var(--gap);
}
.section-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.section-head .more { font-size: 13px; color: var(--gold); }
.section-head .more:hover { text-decoration: underline; }

/* Cards: every project, collection and service is one of these */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}
.card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .15s, background .15s;
}
.card:hover { background: var(--card-hover); border-color: var(--gold-dim); }
.card-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gold); margin-bottom: 6px;
}
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.card-foot { margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--text-faint); }

/* Detail-page body text */
.prose { max-width: 72ch; color: var(--text-dim); }
.prose h2, .prose h3 { color: var(--text); font-weight: 600; }
.prose a { color: var(--gold); }
.prose a:hover { text-decoration: underline; }

/* Footer: the hub's gold line-and-three-diamonds divider */
.footer { margin-top: auto; padding-top: 48px; font-size: 12px; color: var(--text-faint); }
.divider { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gold-dim); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail {
    position: sticky; top: var(--topbar-h); z-index: 9;
    height: auto; padding: 0;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .rail-label, .rail-info { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 0; }
  .nav a { white-space: nowrap; padding: 10px 14px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav a.active { border-bottom-color: var(--gold); }
  .content { padding: 20px 16px 24px; }
}
