/* druvu.com: one reading column and the brand's two colours. */

:root {
  --indigo: #4147d5;
  --indigo-deep: #3338b5;
  --lavender: #d7e0ff;

  --page: #ffffff;
  --page-top: #eceffe;   /* the soft band behind the header and the opening */
  --panel: #f1f3ff;      /* the invitation and the notes */
  --card: #ffffff;
  --text: #17182b;
  --muted: #56587a;
  --line: #e1e4f3;
  --link: var(--indigo);
  --link-hover: var(--indigo-deep);
  --code: #f2f3fa;
  --shadow: 0 1px 2px rgba(23, 24, 43, 0.05), 0 14px 30px -20px rgba(23, 24, 43, 0.28);

  --measure: 43rem;
  --sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #11121b;
    --page-top: #1c1e3a;
    --panel: #1a1c30;
    --card: #181a29;
    --text: #e8eaf7;
    --muted: #a6a9c4;
    --line: #2b2e47;
    --link: #aab5ff;
    --link-hover: var(--lavender);
    --code: #1c1e30;
    --shadow: none;
  }
}

/* ---------- The page ---------- */

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

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

body {
  margin: 0;
  background-color: var(--page);
  background-image: linear-gradient(180deg, var(--page-top), var(--page) 32rem);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem) / 1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: calc(var(--measure) + 3rem);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.skip-link {
  position: absolute;
  left: -100rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--card);
}

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

/* ---------- Header and footer ---------- */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font: 800 1.35rem / 1 var(--display);
  letter-spacing: -0.03em;
  text-decoration: none;
}

/* The mark beside the name: a thought as an outline, the finished thing in front of it. */
.brand .mark {
  width: 1.5rem;
  height: 1.5rem;
}

.brand:hover {
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 1.6rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--text);
}

.site-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
}

.site-footer .row {
  display: flex;
  justify-content: space-between;
  padding-block: 1.75rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer a {
  color: inherit;
}

/* ---------- Text ---------- */

main {
  padding-block: 2.5rem 1rem;
}

h1,
h2,
h3 {
  font-family: var(--display);
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 {
  margin: 3rem 0 0.9rem;
  font-size: clamp(1.45rem, 1.25rem + 1vw, 1.85rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.2rem;
}

p,
ul,
ol,
dl,
pre,
table,
blockquote {
  margin: 0 0 1.15rem;
}

li + li {
  margin-top: 0.4rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

strong {
  font-weight: 650;
}

hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

code {
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: var(--code);
  font: 0.88em var(--mono);
}

pre {
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: var(--code);
  font-size: 0.9em;
  line-height: 1.5;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: none;
}

table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  overflow-x: auto;
}

th,
td {
  padding: 0.6rem 0.9rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 600;
}

blockquote {
  margin-inline: 0;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: var(--panel);
}

blockquote > :last-child {
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  margin: 0 0.4rem 0.6rem 0;
  padding: 0.65rem 1.15rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--indigo);
  color: var(--link-hover);
}

.btn-primary,
.invitation a[href^="mailto:"] {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #ffffff;
}

.btn-primary:hover,
.invitation a[href^="mailto:"]:hover {
  border-color: var(--indigo-deep);
  background: var(--indigo-deep);
  color: #ffffff;
}

/* ---------- The landing ---------- */

.landing main {
  padding-top: 0;
}

.opening {
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(3rem, 8vw, 5.5rem);
}

.opening h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.1rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.opening p {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
  line-height: 1.5;
}

.showcase {
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
}

.showcase h2,
.invitation h2 {
  margin-top: 0;
}

/* The three stories: one card each. */
.showcase ul {
  display: grid;
  gap: 1rem;
  margin-block: 2rem;
  padding: 0;
  list-style: none;
}

.showcase li {
  margin: 0;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 0.97em;
  line-height: 1.6;
}

.showcase li strong a {
  font-weight: 700;
}

.showcase > p:last-child {
  margin-bottom: 0;
}

.invitation {
  padding: clamp(1.75rem, 6vw, 3rem) clamp(1.5rem, 6vw, 3rem);
  border-radius: 22px;
  background: var(--panel);
}

.invitation p:last-child {
  margin: 1.75rem 0 0;
}

.invitation a[href^="mailto:"] {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}

/* On a wide screen the cards and the invitation reach into the margins,
   so the text inside them stays on the column's edge. */
@media (min-width: 52rem) {
  .showcase ul {
    margin-inline: -1.5rem;
  }

  .invitation {
    margin-inline: -3rem;
  }
}

/* ---------- The list of projects ---------- */

.list dl {
  margin: 1.25rem 0 3rem;
  border-top: 1px solid var(--line);
}

.list dt {
  padding-top: 1rem;
  font-weight: 650;
}

.list dt a {
  text-decoration: none;
}

.list dt a[href^="https://"]::after {
  content: " \2197";
  color: var(--muted);
  font-weight: 400;
}

.list dd {
  margin: 0;
  padding: 0.15rem 0 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

/* On a wide screen: the name on the left, its line on the right.
   No gap between the columns, so the row lines run unbroken. */
@media (min-width: 40rem) {
  .list dl {
    display: grid;
    grid-template-columns: 15rem 1fr;
  }

  .list dt,
  .list dd {
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .list dt {
    padding-right: 1.5rem;
  }
}
