/* ─────────────────────────────────────────────────────────────
   Fred Foley — a personal site
   Cream paper, navy ink, and the colours Fred codes things with.
   ───────────────────────────────────────────────────────────── */

:root {
  --cream: #FBF5EA;
  --cream-2: #F1E9DA;
  --ink: #14213D;
  --ink-soft: #3A4461;
  --mute: #6B7284;
  --rule: rgba(20, 33, 61, 0.14);

  --yellow: #F7D154;
  --red: #E4572E;
  --green: #2F8F6B;
  --blue: #4A8FE7;
  --peach: #F6B693;

  --sans: "Figtree", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1180px;
  --gutter: clamp(18px, 4.5vw, 64px);
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.16em; text-decoration-color: var(--red); }
a:hover { color: var(--red); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol, dl { padding: 0; }
b, strong { font-weight: 700; }

mark {
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%);
  color: inherit;
  padding: 0 0.1em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: var(--cream); padding: 0.75rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }

/* ───────────── Top bar ───────────── */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem var(--gutter);
  background: rgba(251, 245, 234, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.95rem;
}
.top-name { font-weight: 800; text-decoration: none; letter-spacing: -0.01em; }
.top-name:hover { color: var(--ink); }
.top-nav { display: flex; gap: 1.4rem; margin-inline: auto; }
.top-nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.top-nav a:hover { color: var(--red); }
.top-time {
  font-family: var(--mono); font-size: 0.78rem; color: var(--mute);
  display: inline-flex; align-items: center; gap: 0.5em; white-space: nowrap;
}
.top-time time { font-variant-numeric: tabular-nums; color: var(--ink); }
.blink { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

/* ───────────── Hello ───────────── */
.hello {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(2rem, 7vh, 5rem) var(--gutter) clamp(1.5rem, 4vh, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.kicker {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mute); margin-bottom: 1.2rem;
}
.hello h1 {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8.5vw, 6.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}
.hello h1 .name { color: var(--red); }
.big {
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  line-height: 1.4;
  max-width: 34rem;
  text-wrap: pretty;
}
.status {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--mute);
}
.status strong { color: var(--ink); font-weight: 500; background: linear-gradient(transparent 60%, rgba(74, 143, 231, 0.28) 60%); }

.portrait {
  position: relative;
  width: min(100%, 440px);
  margin-inline: auto;
}
.portrait img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  background: #0b1a36;
  box-shadow: 0 30px 60px -30px rgba(20, 33, 61, 0.45);
}
.sticker {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%) rotate(-3deg);
  white-space: nowrap;
  padding: 0.4em 0.8em 0.42em;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px -6px rgba(20, 33, 61, 0.35);
}

.foley {
  max-width: 46rem;
  margin: clamp(1rem, 4vh, 2.5rem) auto clamp(2rem, 6vh, 4rem);
  padding: 0 var(--gutter);
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
  text-wrap: pretty;
}
.foley b { font-weight: 800; }
.foley i { font-family: var(--mono); font-style: italic; font-size: 0.85em; color: var(--mute); margin-right: 0.2em; }

/* ───────────── Sections ───────────── */
.sec {
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(3rem, 8vh, 6rem) var(--gutter);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 3.5rem;
}
.sec h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 28ch;
  margin-bottom: clamp(1.8rem, 5vh, 3rem);
  text-wrap: balance;
}
.tag {
  display: block;
  width: fit-content;
  margin-bottom: 0.9rem;
  padding: 0.3em 0.7em 0.32em;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  transform: rotate(-1.5deg);
  transform-origin: left center;
}
.tag-yellow { background: var(--yellow); }
.tag-red    { background: var(--red); color: var(--cream); }
.tag-green  { background: var(--green); color: var(--cream); }
.tag-blue   { background: var(--blue); color: var(--cream); }
.tag-ink    { background: var(--ink); color: var(--cream); }

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px) rotate(-1deg); background: var(--red); border-color: var(--red); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ───────────── The desk ───────────── */
.desk {
  position: relative;
  background: var(--cream-2);
  border-radius: 18px;
  border: 1px solid var(--rule);
  overflow: hidden;
  /* without JS: a plain grid of prints */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
}
.js .desk { display: block; padding: 0; }
.photo {
  background: #fff;
  padding: 0.55rem 0.55rem 0.5rem;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(20, 33, 61, 0.08), 0 12px 28px -12px rgba(20, 33, 61, 0.35);
  user-select: none;
  -webkit-user-select: none;
}
.js .photo {
  position: absolute;
  left: 0; top: 0;
  width: var(--pw, 30%);
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--r, 0deg));
  cursor: grab;
  touch-action: none;
}
.js .photo.settle { transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }
.js .photo.dragging { cursor: grabbing; transition: none; box-shadow: 0 2px 4px rgba(20, 33, 61, 0.1), 0 30px 50px -16px rgba(20, 33, 61, 0.5); }
.photo img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 1px; pointer-events: none; }
.photo figcaption {
  padding: 0.5rem 0.1rem 0.15rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--ink-soft);
}
.desk-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.5rem;
  margin-top: 1.1rem;
  font-family: var(--mono); font-size: 0.85rem; color: var(--mute);
}

/* ───────────── Things I'm into ───────────── */
.into {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.likes { list-style: none; display: grid; gap: 1.1rem; }
.likes li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.likes li::before {
  content: "";
  position: absolute; left: 0; top: 0.45em;
  width: 0.85rem; height: 0.85rem; border-radius: 3px;
  background: var(--c, var(--ink));
  transform: rotate(-8deg);
}
.likes b { color: var(--ink); }

.now { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.now > div {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.now dt { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); padding-top: 0.3rem; }
.now dd { margin: 0; color: var(--ink-soft); }

.puns {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 2px dashed var(--rule);
  border-radius: 18px;
  display: grid;
  gap: 1rem;
  justify-items: start;
}
.pun-label { font-family: var(--mono); font-size: 0.8rem; color: var(--mute); }
.pun {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 24ch;
  text-wrap: balance;
  min-height: 2.4em;
}
.pun.flip { animation: flip 0.35s ease; }
@keyframes flip { from { transform: translateY(8px) rotate(-0.6deg); } to { transform: none; } }

/* ───────────── Work ───────────── */
.work-lead {
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  max-width: 38rem;
  color: var(--ink-soft);
  margin-bottom: clamp(2rem, 5vh, 3rem);
  text-wrap: pretty;
}
.work-plain {
  max-width: 38rem;
  color: var(--mute);
  font-size: 1rem;
  margin: -1.5rem 0 clamp(2rem, 5vh, 3rem);
  text-wrap: pretty;
}
.jobs {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem clamp(1.5rem, 3vw, 3rem);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
.jobs li { padding-top: 0.9rem; border-top: 4px solid var(--c, var(--ink)); }
.jobs h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.jobs p { color: var(--ink-soft); font-size: 1rem; text-wrap: pretty; }

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.rule-lead { font-weight: 700; margin-bottom: 0.6rem; letter-spacing: -0.01em; }
.wont, .will { list-style: none; }
.wont li, .will li { padding: 0.55rem 0 0.55rem 1.8rem; border-bottom: 1px solid var(--rule); position: relative; color: var(--ink-soft); }
.wont li::before, .will li::before {
  position: absolute; left: 0; top: 0.5rem;
  font-family: var(--mono); font-weight: 500;
}
.wont li::before { content: "✕"; color: var(--red); }
.will li::before { content: "✓"; color: var(--green); }
.rule-foot { margin-top: 1.6rem; color: var(--mute); max-width: 40rem; font-size: 1rem; }

/* ───────────── Say g'day ───────────── */
.sec-hello { padding-bottom: clamp(3rem, 8vh, 6rem); }
.hello-big {
  font-size: clamp(1.6rem, 5.2vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  margin-bottom: 1rem;
}
.hello-big a { text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }
.hello-small { color: var(--mute); max-width: 34rem; }

.foot {
  max-width: var(--max);
  margin-inline: auto;
  padding: 1.4rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--mute);
}

/* ───────────── Responsive ───────────── */
@media (max-width: 960px) {
  .hello { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(64vw, 340px); }
  .jobs { grid-template-columns: 1fr 1fr; }
  .into { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 1.05rem; }
  .top { gap: 1rem; padding: 0.75rem var(--gutter); }
  .top-nav { display: none; }
  .top-time { margin-left: auto; }
  .hello { padding-top: 1.5rem; }
  .portrait { width: min(72vw, 300px); }
  .hello h1 { font-size: clamp(2.8rem, 14vw, 4.4rem); }
  .jobs { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .desk { grid-template-columns: 1fr 1fr; gap: 0.8rem; padding: 0.8rem; }
  .now > div { grid-template-columns: 5.5rem 1fr; }
  .foot { flex-direction: column; }
}
