/* Pure Fun Portfolio — base theme.
 *
 * Loosely echoes purefun.fi: navy primary, gold accent, Inter font, dark
 * leaning. Distinct enough to feel like its own thing.
 */

:root {
  --navy: hsl(220 30% 22%);
  --navy-deep: hsl(220 40% 5%);
  --navy-mid: hsl(220 25% 14%);
  --navy-card: hsl(220 25% 18%);
  --gold: hsl(42 62% 48%);
  --gold-link: hsl(42 62% 60%);
  --gold-glow: hsl(42 62% 48% / 0.4);
  --ink: hsl(0 0% 96%);
  --ink-dim: hsl(0 0% 70%);
  --ink-faint: hsl(0 0% 50%);
  --border: hsl(220 20% 30%);

  --font-body: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", "Segoe UI", Roboto, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 30px -8px hsl(220 50% 4% / 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--navy-deep);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--gold-link);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover,
a:focus-visible {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em 0;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}
h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

input,
textarea {
  font: inherit;
  background: var(--navy-mid);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5em 0.75em;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -1px;
  border-color: transparent;
}

/* Site chrome */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  background: var(--navy);
  border-bottom: 1px solid var(--border);
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-header__brand .lambda {
  color: var(--gold);
  font-weight: 700;
  margin-right: 0.4em;
}

.site-header__company {
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.site-footer {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--border);
  background: var(--navy);
  color: var(--ink-dim);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer a {
  color: var(--ink-dim);
  text-decoration: underline;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.hero {
  padding: clamp(2rem, 8vw, 5rem) 0 1rem;
  text-align: center;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.25em;
}

.hero__tagline {
  color: var(--ink-dim);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 0 auto;
  max-width: 60ch;
}

/* Forbidden / fallback pages */

.notice {
  max-width: 50ch;
  margin: 6rem auto;
  padding: 2.5rem;
  text-align: center;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.notice h1 {
  color: var(--gold);
}

/* Project detail (fallback / single-project view) */

.project-detail {
  padding: 2rem 0;
}

.project-detail__hero img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.project-detail__meta {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.project-detail__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-left: 0.5em;
}

.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  font-size: 0.75rem;
  background: var(--navy-card);
  border: 1px solid var(--border);
  border-radius: 1em;
  color: var(--ink-dim);
}

.project-detail__body {
  max-width: 70ch;
  margin: 0 auto;
}

.project-detail__body h2,
.project-detail__body h3 {
  margin-top: 1.5em;
}

.project-detail__body code {
  background: var(--navy-mid);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.project-detail__body pre {
  background: var(--navy-mid);
  padding: 1em;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.project-detail__links {
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-block;
  padding: 0.6em 1.2em;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition:
    background 150ms ease,
    transform 100ms ease;
}

.button:hover,
.button:focus-visible {
  background: hsl(42 62% 56%);
  color: var(--navy-deep);
  text-decoration: none;
  transform: translateY(-1px);
}

.button--ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.button--ghost:hover,
.button--ghost:focus-visible {
  background: var(--gold);
  color: var(--navy-deep);
}

/* Admin */

.admin-layout {
  padding: 2rem clamp(1rem, 4vw, 3rem);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.admin-nav a {
  color: var(--ink-dim);
}

.admin-nav a.is-active {
  color: var(--gold);
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin-top: 1rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.6em 0.75em;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--ink-dim);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--navy-mid);
}

.admin-table tr:hover {
  background: hsl(220 25% 16%);
}

.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.admin-form label {
  font-size: 0.82rem;
  color: var(--ink-dim);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-form input {
  min-width: 18ch;
}

.token-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--ink-dim);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.stat-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.stat-card__label {
  color: var(--ink-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.stat-card__value {
  color: var(--gold);
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.status-pill {
  display: inline-block;
  padding: 0.15em 0.5em;
  border-radius: 1em;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-pill--active {
  background: hsl(140 50% 25%);
  color: hsl(140 50% 85%);
}
.status-pill--revoked {
  background: hsl(0 50% 30%);
  color: hsl(0 50% 90%);
}
.status-pill--expired {
  background: hsl(30 30% 30%);
  color: hsl(30 30% 90%);
}

/* Responsive tightening */
@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  .admin-form {
    flex-direction: column;
    align-items: stretch;
  }
}
