/**
 * linkhill.css — LinkHill page baseline styles.
 * Project: linkhill
 * SPDX-License-Identifier: MIT
 * Copyright (c) 2026 Hillwork, LLC
 */

/* ===== Minimal baseline ===== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);

  /* Light */
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --link: #0b57d0;
  --link-hover: #0849b3;
  --card-bg: #ffffff;
  --button-bg: #111827;
  --button-text: #ffffff;
  --button-hover: #000000;

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c; --text: #f3f4f6; --muted: #a1a1aa;
    --border: #232428; --card-bg: #111214;
    --button-bg: #e5e7eb; --button-text: #111827; --button-hover: #ffffff;
  }
}

/* Profile theme overrides: force light or dark regardless of system preference */
body.theme-light {
  --bg: #ffffff; --text: #1a1a1a; --muted: #6b7280;
  --border: #e5e7eb; --link: #0b57d0; --link-hover: #0849b3;
  --card-bg: #ffffff; --button-bg: #111827; --button-text: #ffffff; --button-hover: #000000;
}
body.theme-dark {
  --bg: #0b0b0c; --text: #f3f4f6; --muted: #a1a1aa;
  --border: #232428; --card-bg: #111214;
  --button-bg: #e5e7eb; --button-text: #111827; --button-hover: #ffffff;
}
/* theme-custom: no override, uses prefers-color-scheme */

* { box-sizing: border-box; }
html, body { height: 100%; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout */
.container {
  max-width: 720px;
  width: 100%;
  padding: 0 var(--s-5);
  margin: 0 auto;
}
/* Mobile: body-level horizontal inset so text isn’t tight to edges (phones, tablets, notched iPhones) */
@media (max-width: 768px) {
  body {
    padding-left: max(20px, 11%, env(safe-area-inset-left, 0px));
    padding-right: max(20px, 11%, env(safe-area-inset-right, 0px));
  }
  .container {
    padding-left: 0;
    padding-right: 0;
  }
}
header.container { padding: var(--s-7) 0 var(--s-5); }
main.container { padding: var(--s-5) 0 var(--s-8); }
footer { padding: var(--s-7) 0 var(--s-8); color: var(--muted); font-size: .95rem; border-top: 1px solid var(--border); }
.stack > * + * { margin-top: var(--s-5); }
.divider {
  height: 1px; margin: var(--s-6) 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Type */
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(26px, 3.5vw, 36px); }
h2 { font-size: clamp(20px, 2.6vw, 28px); }
h3 { font-size: clamp(18px, 2.2vw, 22px); }
p { margin: 0; } p + p { margin-top: var(--s-4); }
.muted { color: var(--muted); }

.site-title { font-weight: 700; font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.01em; margin: 0 0 var(--s-2); }
/* Homepage: product name bigger and more prominent */
.home-page .hero .site-title { font-size: clamp(32px, 5vw, 48px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--s-3); }
.site-subtitle { color: var(--muted); font-size: .95rem; margin: 0; line-height: 1.5; }

/* Profile (public page header) */
header.container .profile { text-align: center; }
header.container .avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto var(--s-3); }
@media (min-width: 400px) {
  header.container .avatar { width: 112px; height: 112px; }
}

/* Links */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--link) 60%, transparent);
  outline-offset: 2px; border-radius: 6px;
}

/* Link "cards" for items with blurbs */
.card {
  display: block;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow);
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
  color: inherit;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.04), 0 12px 28px rgba(0,0,0,.08);
  border-color: color-mix(in oklab, var(--border) 60%, var(--link) 40%);
  color: inherit; text-decoration: none;
}
.card:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--link) 60%, transparent);
  outline-offset: 2px; border-radius: var(--radius);
}
.card h3 { margin-bottom: var(--s-2); }
.card p { color: var(--muted); margin: 0; font-size: .95rem; }

/* Full-width buttons for primary links */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3);
  width: 100%; padding: var(--s-4) var(--s-5);
  border-radius: var(--radius); background: var(--button-bg); color: var(--button-text);
  font-weight: 600; letter-spacing: .01em; border: 1px solid transparent;
  transition: background .15s ease, transform .06s ease, box-shadow .12s ease;
  text-decoration: none; box-shadow: var(--shadow);
}
.button:hover { background: var(--button-hover); transform: translateY(-1px); color: var(--button-text); text-decoration: none; }
.button:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--button-bg) 40%, #6aa9ff 60%); outline-offset: 2px;
  color: var(--button-text); text-decoration: none;
}
.button .icon { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.button .icon svg { width: 20px; height: 20px; fill: currentColor; }
.button .title { flex-shrink: 0; text-align: center; }

/* List of links */
.link-list { display: grid; grid-template-columns: 1fr; gap: var(--s-4); list-style: none; padding: 0; margin: 0; }

/* Centered section heading on public profile (between links) */
.entry-heading { text-align: center; margin: var(--s-6) 0 var(--s-3); font-size: clamp(18px, 2.2vw, 22px); font-weight: 600; color: var(--text); }
.entry-heading:first-child { margin-top: 0; }

/* Custom footer on public profile (below links) */
.profile-footer { text-align: center; margin-top: var(--s-6); padding-top: var(--s-5); color: var(--muted); font-size: .95rem; line-height: 1.5; }
.profile-footer p { margin: 0 0 var(--s-2); }
.profile-footer p:last-child { margin-bottom: 0; }

/* Homepage: CTA group and benefits */
.cta-group { display: flex; flex-direction: column; gap: var(--s-4); align-items: center; }
.cta-group .button { width: 75%; }
.button--secondary {
  background: transparent; color: var(--text); border: 2px solid var(--border);
}
.button--secondary:hover { background: var(--border); color: var(--text); }
.link-tertiary { font-size: .95rem; color: var(--muted); }
.link-tertiary:hover { color: var(--link); }
.link-tertiary:focus-visible { outline: 3px solid color-mix(in oklab, var(--link) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
.benefit-cards { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 600px) { .benefit-cards { grid-template-columns: repeat(3, 1fr); } }
.callout { margin-top: var(--s-6); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Footer */
.footer { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--border); color: var(--muted); font-size: .95rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-bottom: var(--s-2); }
.footer nav a { color: var(--muted); }
.footer nav a:hover { color: var(--link); }
.footer-copy { margin: 0; }

/* Images */
img { max-width: 100%; height: auto; border-radius: 10px; }
