/* haydenball.net: a small bookshop in Valletta */

:root {
  --font-heading: 'DM Serif Display', 'Iowan Old Style', Georgia, serif;
  --font-body: 'DM Sans', system-ui, 'Segoe UI', Roboto, sans-serif;

  --stone: #EFE3CC;      /* Maltese limestone */
  --stone-2: #E5D6B8;
  --paper: #F8F1E3;
  --ink: #2A2522;
  --ink-soft: #5E554D;
  --line: #D6C6A6;
  --green: #2F5D50;      /* Valletta balcony green: the one accent */
  --shelf: #6E4F37;

  --gap-s: 1.5rem;
  --gap-m: 3rem;
  --gap-l: clamp(4rem, 8vw, 7rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; background: var(--stone); color: var(--ink); font-family: var(--font-body); font-size: 1.08rem; line-height: 1.65; }

a { color: var(--green); font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 10; }
.skip:focus { top: 1rem; }

.wrap { max-width: 70rem; margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; margin: 0; line-height: 1.05; letter-spacing: -.01em; }
h1 { font-size: clamp(3.2rem, 8vw, 6rem); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); margin-bottom: .6rem; }
h3 { font-size: 1.5rem; line-height: 1.15; }
.kicker { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--green); }
.lede { color: var(--ink-soft); max-width: 58ch; margin: 0 0 var(--gap-s); }

section { padding-top: var(--gap-l); scroll-margin-top: 1rem; }

/* ---------- Header ---------- */

.topbar { border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem 1.25rem; padding-top: .6rem; padding-bottom: .6rem; }
.brand { font-family: var(--font-heading); font-size: 1.5rem; color: var(--ink); font-weight: 400; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav, .langs { display: flex; flex-wrap: wrap; gap: .1rem; }
.nav a, .langs a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 .7rem;
  color: var(--ink-soft); font-weight: 500; font-size: .95rem; text-decoration: none; border-bottom: 2px solid transparent;
}
.langs a { font-size: .82rem; font-weight: 700; letter-spacing: .06em; min-width: 40px; padding: 0 .45rem; }
.nav a:hover, .langs a:hover { color: var(--ink); }
.nav a[aria-current="page"], .langs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }

/* ---------- Hero ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--gap-m); align-items: center; padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.portrait { margin: 0; position: relative; }
.portrait img { display: block; width: 100%; height: auto; border-radius: 999px 999px 0 0; }   /* a Maltese arch */
.portrait figcaption { font-size: .85rem; color: var(--ink-soft); margin-top: .6rem; }
.hero h1 { margin: .7rem 0 1rem; }
.hero .role { font-family: var(--font-heading); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.25; margin: 0 0 .8rem; }
.hero .pitch { color: var(--ink-soft); max-width: 46ch; margin: 0 0 var(--gap-s); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: .55rem 1.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; white-space: nowrap; text-decoration: none; cursor: pointer;
  color: var(--paper); background: var(--green); border: 2px solid var(--green); border-radius: 999px;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.button:hover { background: transparent; color: var(--green); }
.button.ghost { background: transparent; color: var(--green); }
.button.ghost:hover { background: var(--green); color: var(--paper); }

/* ---------- The shelf ---------- */

.shelf-wrap { position: relative; padding: 2rem 1.5rem 0; }
.shelf { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; align-items: flex-end; gap: clamp(1rem, 4vw, 3rem); position: relative; z-index: 1; }
.shelf li { width: min(30%, 13.5rem); }
.shelf a { display: block; text-decoration: none; color: var(--ink); }
.shelf img {
  display: block; width: 100%; height: auto; border-radius: 2px 6px 6px 2px;
  box-shadow: inset 4px 0 0 rgba(0, 0, 0, .12), 0 12px 24px rgba(42, 37, 34, .22);
  transition: transform .4s var(--ease);
}
.shelf a:hover img, .shelf a:focus-visible img { transform: translateY(-10px) rotate(-1.5deg); }
.shelf-plank { height: 18px; margin: 0 -1.5rem; background: var(--shelf); border-radius: 3px; box-shadow: 0 10px 18px rgba(42, 37, 34, .18); position: relative; z-index: 0; }
.labels { display: flex; justify-content: center; gap: clamp(1rem, 4vw, 3rem); margin-top: 1rem; }
.labels .t { width: min(30%, 13.5rem); font-family: var(--font-heading); font-weight: 400; font-size: 1.15rem; line-height: 1.2; color: var(--ink); text-decoration: none; }
.labels .t:hover { color: var(--green); text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
  .shelf li { animation: shelve 650ms var(--ease) both; }
  .shelf li:nth-child(2) { animation-delay: 110ms; }
  .shelf li:nth-child(3) { animation-delay: 220ms; }
}
@keyframes shelve { from { transform: translateY(-36px) rotate(-3deg); } to { transform: none; } }

/* ---------- About ---------- */

.about { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap-m); align-items: start; }
.about p { margin: 0 0 var(--gap-s); max-width: 64ch; }
.facts { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: .4rem 1.2rem; }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--green); padding-top: .2rem; }
.facts dd { margin: 0; font-weight: 500; }

/* ---------- What I write ---------- */

.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.topics li { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem 1.4rem; }
.topics h3 { margin-bottom: .4rem; }
.topics p { margin: 0; color: var(--ink-soft); }

/* ---------- Off the clock / band ---------- */

.off p { font-family: var(--font-heading); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.35; max-width: 34ch; margin: 0; }
.band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem 2rem; margin-top: var(--gap-l); padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--green); color: var(--paper); border-radius: 18px; }
.band p { margin: 0; font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; max-width: 26ch; }
.band .button { background: var(--paper); border-color: var(--paper); color: var(--green); }
.band .button:hover { background: transparent; color: var(--paper); }

/* ---------- Books page ---------- */

.page-head { padding-top: clamp(2.5rem, 6vw, 4rem); }
.page-head h1 { font-size: clamp(3rem, 7vw, 5rem); margin: .5rem 0 .75rem; }
.book { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: var(--gap-m); align-items: start; padding: var(--gap-m) 0; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.book:first-of-type { border-top: 0; }
.book img { display: block; width: 100%; height: auto; border-radius: 2px 6px 6px 2px; box-shadow: inset 4px 0 0 rgba(0,0,0,.12), 0 12px 24px rgba(42,37,34,.22); }
.book h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin: .4rem 0 .3rem; }
.book .subtitle { font-family: var(--font-heading); font-size: 1.3rem; color: var(--ink-soft); margin: 0 0 1rem; }
.book p { max-width: 62ch; }
.book h3 { font-family: var(--font-body); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--green); margin: 1.5rem 0 .6rem; }
.parts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.parts li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .8rem; font-size: .92rem; }
.book .extent { color: var(--ink-soft); font-size: .95rem; }

/* ---------- Career page ---------- */

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--line); }
.history li:last-child { border-bottom: 1px solid var(--line); }
.history .when { font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; color: var(--green); padding-top: .35rem; }
.history strong { display: block; font-family: var(--font-heading); font-weight: 400; font-size: 1.6rem; line-height: 1.15; }
.history span.org { color: var(--ink-soft); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: var(--gap-m); }
.cards div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; }
.cards b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--green); margin-bottom: .4rem; }
.cards p { margin: 0; }
.cards span { color: var(--ink-soft); }

/* ---------- Contact page ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--gap-m); align-items: start; }
.contact p { margin: 0 0 1rem; max-width: 46ch; }
.form { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: .3rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .55rem .8rem;
  font: inherit; color: var(--ink); background: #FFFDF8; border: 1px solid var(--line); border-radius: 10px;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.5rem; }
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--green); outline-offset: 0; border-color: var(--green); }
.consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; line-height: 1.45; margin: 1.1rem 0 1.3rem; color: var(--ink-soft); }
.consent input { width: 20px; height: 20px; margin-top: .1rem; flex-shrink: 0; accent-color: var(--green); }
.sent { display: none; margin-top: 1rem; font-weight: 700; color: var(--green); }
.sent.is-visible { display: block; }

/* ---------- Prose / footer ---------- */

.prose { max-width: 48rem; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 .4rem; }
.prose p { margin: 0 0 1rem; }
.site-footer { margin-top: var(--gap-l); border-top: 1px solid var(--line); padding: var(--gap-m) 0; }
.site-footer .brand { margin-bottom: .5rem; }
.site-footer p { margin: 0 0 .5rem; font-size: .92rem; color: var(--ink-soft); max-width: 72ch; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.big { font-family: var(--font-heading); font-size: clamp(5rem, 18vw, 9rem); line-height: .9; color: var(--green); margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero, .about, .contact { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 22rem; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .topics { grid-template-columns: minmax(0, 1fr); }
  .book { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .book img { max-width: 12rem; }
  .history li { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .labels .t { font-size: .95rem; }
  .button { width: 100%; }
}
