/* olly.st: one page, Neon Midnight colours from saltedlolly.com.
   Dark by default; light when the visitor's system is set to light. */

:root {
  color-scheme: dark;
  --bg: #050816;
  --text: #f7f3ec;
  --muted: #a9b2c8;
  --faint: #a2abc3;
  --panel: rgba(12, 18, 40, 0.72);
  --panel-hover: rgba(18, 26, 54, 0.86);
  --border: rgba(160, 175, 220, 0.16);
  --border-hover: rgba(255, 137, 186, 0.5);
  --accent: #ff89ba;
  --accent-2: #8cc9ff;
  --focus: #8cc9ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --gradient: linear-gradient(115deg, #ff7b73, #ff5f9b 40%, #b35cff 72%, #4fa9ff);
  --fallback-bg:
    radial-gradient(60% 50% at 15% 10%, rgba(255, 95, 155, 0.16), transparent 70%),
    radial-gradient(55% 45% at 85% 30%, rgba(79, 169, 255, 0.16), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(179, 92, 255, 0.14), transparent 70%);

  /* Read by site.js for the background animation: "r, g, b" triplets. Text sits
     directly on these, so keep them dark enough to pass contrast at full strength. */
  --field-base: 5, 8, 22;
  --field-hues: 92, 18, 72 | 58, 26, 128 | 16, 58, 122 | 104, 30, 44;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #e9edf5;
    --text: #141a30;
    --muted: #424b6a;
    --faint: #434c69;
    --panel: rgba(255, 255, 255, 0.74);
    --panel-hover: rgba(255, 255, 255, 0.92);
    --border: rgba(30, 40, 80, 0.12);
    --border-hover: rgba(176, 40, 95, 0.45);
    --accent: #b0285f;
    --accent-2: #1a5fb8;
    --focus: #1a5fb8;
    --shadow: 0 16px 40px rgba(20, 28, 60, 0.1);
    /* Deepened so the wordmark keeps its contrast on a pale page. */
    --gradient: linear-gradient(115deg, #b83530, #b0285f 40%, #7b3fd6 72%, #1a5fb8);
    --fallback-bg:
      radial-gradient(60% 50% at 15% 10%, rgba(255, 95, 155, 0.14), transparent 70%),
      radial-gradient(55% 45% at 85% 30%, rgba(79, 169, 255, 0.16), transparent 70%),
      radial-gradient(50% 40% at 50% 100%, rgba(179, 92, 255, 0.12), transparent 70%);

    --field-base: 233, 237, 245;
    --field-hues: 255, 176, 206 | 206, 184, 255 | 158, 208, 255 | 255, 192, 164;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fallback-bg), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* The canvas is always laid out and just transparent until the animation is
   ready, then fades in over the fallback gradient. Switching it from
   display: none instead left Safari sometimes never showing it on a first,
   uncached visit, even though it was drawing. */
.field {
  display: block;
  opacity: 0;
  transition: opacity 0.8s ease-out;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  /* The large viewport, so the field carries on behind iOS Safari's
     see-through toolbar instead of stopping where it starts. */
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}

.has-field .field {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .field {
    transition: none;
  }
}

.page {
  position: relative;
  z-index: 1;
  width: min(960px, 100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  margin-inline: auto;
  padding-block: clamp(48px, 10vh, 112px) calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main {
  display: grid;
  gap: 40px;
}

a {
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero */

.hero {
  margin-bottom: 48px;
}

.masthead {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 24px);
}

.avatar {
  flex: none;
  display: block;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--border);
  transition: box-shadow 0.2s;
}

.avatar:hover {
  box-shadow: 0 0 0 3px var(--border-hover);
}

.avatar img {
  display: block;
  width: clamp(64px, 14vw, 112px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

.wordmark {
  margin: 0;
  font-size: clamp(3.5rem, 15vw, 7.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.wordmark a {
  display: inline-block;
  /* The gradient is clipped to this box, so it needs room for the y's tail,
     which hangs lower in some fallback fonts (Segoe UI on Windows). The
     negative margin keeps the spacing below the title as it was. */
  padding-bottom: 0.25em;
  margin-bottom: -0.17em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  border-radius: 8px;
}

.name {
  margin: 16px 0 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 6px 0 0;
  /* Room for the whole tagline on one line on a laptop; where it does wrap
     (phones), balance keeps the two lines even rather than leaving one word. */
  max-width: 48em;
  text-wrap: balance;
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.125rem);
}

/* Shared */

.eyebrow {
  display: block;
  margin: 0 0 12px;
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}

a.card:hover {
  border-color: var(--border-hover);
  background: var(--panel-hover);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.card:hover {
    transform: translateY(-2px);
  }
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Round icons, one per panel. */

.icon {
  flex: none;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  /* Keeps the circle's edge visible when an icon is the same colour as its panel. */
  box-shadow: 0 0 0 1px var(--border);
}

.icon--large {
  width: 64px;
  height: 64px;
}

/* For a logo with no background of its own. */
.icon--disc {
  padding: 3px;
  background: #fff;
}

/* The blog: the main panel, with its latest posts. */

.blog {
  position: relative;
  gap: 24px;
  padding: 28px 30px;
  overflow: hidden;
}

.blog::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--gradient);
}


.blog__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 18px;
  border-radius: 12px;
  text-decoration: none;
}

.blog__title {
  display: block;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.blog__text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 36em;
}

.blog__go {
  align-self: center;
  color: var(--accent);
  font-weight: 650;
}

.blog__link:hover .blog__go {
  color: var(--accent-2);
}

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.posts[hidden] {
  display: none;
}

.post {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.post:hover {
  border-color: var(--border-hover);
  background: var(--panel-hover);
}

.post__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--border);
}

.post__body {
  display: block;
  padding: 14px 16px 16px;
}

/* Share cards (DigiNode Tools): shown whole, as they hold the post's title. */
.posts--cards .post__image {
  aspect-ratio: 1200 / 630;
}

/* Holds the space until the first posts arrive. */
.post--loading .post__body {
  min-height: 9em;
}

.post__date {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.post__title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.post__preview {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

@media (max-width: 720px) {
  .blog__link {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .blog__go {
    grid-column: 2;
  }

  .posts {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Picture beside the words, so three posts don't fill the whole phone. */
  .post {
    flex-direction: row;
  }

  .post__image {
    flex: none;
    width: 34%;
    height: auto;
    aspect-ratio: auto;
    min-height: 100%;
  }

  .post__body {
    min-width: 0;
    padding: 12px 14px;
  }

  .posts--cards .post__image {
    align-self: flex-start;
    aspect-ratio: 1200 / 630;
    min-height: 0;
  }

  /* DigiNode Tools' release titles are long. */
  .posts--cards .post__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .post__preview {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

/* Projects */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Same layout as the blog panel: the icon, then all the words in one column. */
.project {
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
}

.project__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  align-self: stretch;
  min-width: 0;
}

.project__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.project__text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9375rem;
  flex-grow: 1;
}

.project__host {
  margin-top: 14px;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
}

.project:hover .project__host {
  color: var(--accent-2);
}

/* Elsewhere */

.elsewhere {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill,
.copy {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.pill:hover,
.copy:hover {
  border-color: var(--border-hover);
  background: var(--panel-hover);
}

.pill svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
  color: var(--accent-2);
}

.pill svg.stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  color: var(--accent);
}

.nostr {
  display: flex;
  gap: 6px;
}

.npub {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  font-weight: 500;
}

.copy {
  cursor: pointer;
  color: var(--muted);
}

.copy[hidden] {
  display: none;
}

/* Footer */

.footer {
  margin-top: auto;
  padding-top: 56px;
  color: var(--faint);
  font-size: 0.875rem;
}

.footer p {
  margin: 0;
}

.footer strong {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 520px) {
  .hero {
    margin-bottom: 36px;
  }

  main {
    gap: 32px;
  }

  .blog {
    padding: 24px 22px;
  }

  .projects {
    grid-template-columns: minmax(0, 1fr);
  }

  .icon--large {
    width: 48px;
    height: 48px;
  }

  .card {
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar,
  .card,
  .post,
  .pill,
  .copy {
    transition: none;
  }
}
