/* ---------------------------------------------------------------------------
   Seamus Allen — portfolio
   Shared stylesheet for index.html, about.html and 404.html.
   --------------------------------------------------------------------------- */

/* --- Fonts ------------------------------------------------------------------
   Self-hosted so the site has no third-party requests. woff2 first (every
   browser since ~2016), ttf kept as a fallback for anything older. */
@font-face {
  font-family: 'Gelasio';
  src: url('fonts/Gelasio-VariableFont_wght.woff2') format('woff2-variations'),
       url('fonts/Gelasio-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gelasio';
  src: url('fonts/Gelasio-Italic-VariableFont_wght.woff2') format('woff2-variations'),
       url('fonts/Gelasio-Italic-VariableFont_wght.ttf') format('truetype-variations');
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('fonts/Lato-Regular.woff2') format('woff2'),
       url('fonts/Lato-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('fonts/Lato-Bold.woff2') format('woff2'),
       url('fonts/Lato-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('fonts/Lato-Black.woff2') format('woff2'),
       url('fonts/Lato-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ---------------------------------------------------------------- */
:root {
  --bg: #14171a;
  --panel: #1b1f22;
  --panel-hover: #242a2d;
  --line: #2c3236;
  --line-hover: #3a4147;
  --text: #e8eae6;
  --muted: #a4a9a3;
  --dim: #6e7470;
  --accent: #8fa885;
  --accent-hover: #a8bd9d;
  --accent-ink: #0f1612;
  --pending: #c9a96b;

  --serif: 'Gelasio', Georgia, 'Times New Roman', serif;
  --sans: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  --shell: 1280px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --speed: 120ms;
}

/* --- Base ------------------------------------------------------------------ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

body {
  font-family: var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); }

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

img { max-width: 100%; }

.shell {
  max-width: var(--shell);
  margin: 0 auto;
}

.page {
  min-height: 100vh;
  background: var(--bg);
  padding: 0 24px 96px;
}

/* Visible only to screen readers — used for the skip link and section labels. */
.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;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 12px 20px;
  background: var(--panel);
  border: 1px solid var(--line-hover);
  border-radius: 0 0 8px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
  color: var(--text);
}

/* --- Header ---------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
a.brand:hover { color: var(--text); }

.site-nav {
  display: flex;
  gap: 24px;
  align-items: baseline;
  font-size: 13px;
}

.site-nav a {
  color: var(--muted);
  transition: color var(--speed) var(--ease);
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current='page'] { color: var(--text); }

/* --- Section labels -------------------------------------------------------- */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 16px;
}

.rule-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* --- Project grids --------------------------------------------------------- */
.work { padding-top: 48px; }

.grid {
  display: grid;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.grid--featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--rest {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

/* The tile is an <a> when the project has somewhere to go, and a <div>
   otherwise — so placeholder projects are not announced as links. */
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color var(--speed) var(--ease);
}
.grid--featured .tile { aspect-ratio: 16 / 9; }
.grid--rest .tile { aspect-ratio: 4 / 3; }

a.tile:hover { border-color: var(--line-hover); }

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Projects with no artwork show their title as the artwork. */
.tile-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--panel);
}
.tile-placeholder span {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.15;
}
.grid--featured .tile-placeholder span { font-size: clamp(24px, 2.6vw, 34px); }
.grid--rest .tile-placeholder span { font-size: 24px; }

.tile-meta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 24px;
  opacity: 0;
  transition: opacity var(--speed) var(--ease);
  background: linear-gradient(
    to top,
    rgba(20, 23, 26, 0.97) 0%,
    rgba(20, 23, 26, 0.74) 48%,
    rgba(20, 23, 26, 0.12) 100%
  );
}
.grid--rest .tile-meta { gap: 8px; padding: 18px; }

.tile:hover .tile-meta,
.tile:focus-within .tile-meta { opacity: 1; }

/* Touch devices have no hover, so the metadata would be unreachable —
   show it permanently there instead. */
@media (hover: none) {
  .tile-meta { opacity: 1; }
}

.tile-status {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* currentColor so the ring matches the label — amber for pending,
     green for live — without restating either colour. */
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--pending);
}
.status--live { color: var(--accent); }

.tile-year {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tile-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.grid--rest .tile-name { font-size: 20px; }

.tile-tags {
  font-size: 13px;
  color: var(--muted);
}

/* --- "See more work" toggle ------------------------------------------------ */
.toggle-row {
  display: flex;
  justify-content: center;
  padding: 32px 0 0;
}

.button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 24px;
  min-height: 44px;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.button:hover {
  background: var(--panel-hover);
  border-color: var(--line-hover);
}
.button:active { transform: scale(0.98); }

/* The extra projects are always present in the HTML — JS only hides them.
   With JS disabled the [hidden] attribute is never applied, so everything
   stays visible and the toggle button is removed instead (see the <noscript>
   block in index.html). */
.grid--rest[hidden] { display: none; }

/* --- About page ------------------------------------------------------------ */
.about-grid {
  padding-top: 48px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.portrait {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  aspect-ratio: 4 / 5;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 18%;
  display: block;
}

.about-copy { max-width: 72ch; }

.about-copy h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 36px);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  margin-bottom: 20px;
}

.lede {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}

/* --- Experience / education ------------------------------------------------ */
.section { margin-top: 64px; }
.section--tight { margin-top: 48px; }

.entry {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: 0; }

.entry-body {
  flex: 1 1 480px;
  min-width: 0;
}

.entry-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.entry-title .sep {
  color: var(--dim);
  font-weight: 400;
}

.entry-date {
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.entry-body ul {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry-body p {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 80ch;
}

/* --- Skills ---------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.chip {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
}

/* --- Call to action buttons ------------------------------------------------ */
.cta-row {
  margin-top: 48px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}

.cta--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.cta--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.cta--secondary {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
}
.cta--secondary:hover {
  background: var(--panel-hover);
  border-color: var(--line-hover);
  color: var(--text);
}

.cta:active { transform: scale(0.98); }

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
  margin: 64px auto 0;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--dim);
}
.site-footer--ruled {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.site-footer a {
  color: var(--muted);
  transition: color var(--speed) var(--ease);
}
.site-footer a:hover { color: var(--text); }

/* --- 404 ------------------------------------------------------------------- */
.notfound {
  padding: 96px 0;
  max-width: 60ch;
}
.notfound h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 36px);
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.notfound p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 28px;
}

/* --- Responsive ------------------------------------------------------------
   The original draft measured the container in JS. These breakpoints are the
   viewport equivalents (container width + the 24px page padding either side),
   so the layout matches without needing scripts. */
@media (max-width: 948px) {
  .grid--rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 280px; }
}

@media (max-width: 608px) {
  .grid--featured,
  .grid--rest { grid-template-columns: minmax(0, 1fr); }
  .grid--featured .tile { aspect-ratio: 1 / 1; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
  .button:active,
  .cta:active { transform: none; }
}

@media print {
  .site-nav, .toggle-row, .cta-row, .skip-link { display: none; }
  html, body, .page { background: #fff; }
  body { color: #000; }
}
