/* ============================================================
   Thomas Kelly — personal brand site
   Modernist: matte charcoal, gold accent, zero radius, flush left.
   ============================================================ */

:root {
  --color-bg:          #141416;
  --color-surface:     #1d1d21;
  --color-text:        #f2f1ed;
  --color-accent:      #b08d57;
  --color-accent-600:  #9c7c4c;
  --color-accent-700:  #856941;
  --color-divider:     rgba(242, 241, 237, .24);

  --gutter:  clamp(20px, 5vw, 72px);
  --pad-y:   clamp(64px, 8vw, 120px);
  --shell:   1440px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }   /* without this, width/height attrs letterbox scaled images */
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.0; letter-spacing: -.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* No radius anywhere — enforced. */
* { border-radius: 0 !important; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 12px 18px;
  background: var(--color-accent); color: #141416;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Text for screen readers and search engines only. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Shared type ──────────────────────────────────────────── */

.kicker {
  margin: 0 0 20px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.4;
}

.label {
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .62;
}

.section-title {
  margin: 0 0 24px;
  font-size: clamp(34px, 3.2vw, 44px);
  letter-spacing: -.03em;
  max-width: 16ch;
}

.body-text { max-width: 60ch; }
.body-text + .body-text { margin-top: 18px; }
.muted { opacity: .68; }

.section { padding-block: var(--pad-y); }
.section-head { margin-bottom: 56px; }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn .icon { margin-left: auto; }

.btn-primary {
  background: var(--color-accent);
  color: #141416;
  border-color: var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-600); border-color: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); border-color: var(--color-accent-700); }

.btn-secondary {
  border-color: var(--color-divider);
  color: var(--color-text);
}
.btn-secondary:hover { border-color: var(--color-text); }

.icon {
  width: 18px; height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 20, 22, .8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding-block: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.monogram {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
}
.monogram-sm { width: 28px; height: 28px; font-size: 11px; }

.brand-name { font-size: 14px; font-weight: 600; }

.site-nav {
  display: flex;
  gap: 28px;
  margin-inline: auto;
}
.site-nav a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .72;
  transition: opacity .2s var(--ease), color .2s var(--ease);
}
.site-nav a:hover { opacity: 1; }
.site-nav a.is-active { color: var(--color-accent); opacity: 1; }

.header-cta { padding: 12px 18px; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  place-items: center;
  margin-left: auto;
  border: 1px solid var(--color-divider);
}
.menu-toggle .icon { width: 20px; height: 20px; }
.menu-toggle .icon-close { display: none; }

/* ── Mobile nav overlay ───────────────────────────────────── */

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(20, 20, 22, .96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-y: auto;
  padding-top: 96px;
  padding-bottom: 40px;
}
.mobile-nav[hidden] { display: none; }

.mobile-nav-list { border-top: 2px solid var(--color-divider); }
.mobile-nav-list li { border-bottom: 1px solid var(--color-divider); counter-increment: mnav; }
.mobile-nav-list { counter-reset: mnav; }
.mobile-nav-list a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-block: 22px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.mobile-nav-list a::before {
  content: "0" counter(mnav);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
}

.mobile-nav-cta {
  display: flex;
  width: 100%;
  margin-top: 32px;
}

body.menu-open { overflow: hidden; }
body.menu-open .menu-toggle .icon-menu { display: none; }
body.menu-open .menu-toggle .icon-close { display: block; }

/* ── Hero ─────────────────────────────────────────────────── */

.hero { position: relative; padding-block: clamp(56px, 7vw, 104px) var(--pad-y); }

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(42% 46% at 82% 40%, rgba(176, 141, 87, .09), transparent 70%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 72px;
  align-items: start;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.hero-kicker::before {
  content: "";
  width: 28px; height: 2px;
  background: var(--color-accent);
  flex: none;
}

.hero-title {
  font-size: clamp(46px, 6.4vw, 92px);
  letter-spacing: -.03em;
  margin-bottom: 32px;
}
.hero-title span { display: block; }
.hero-title .accent { color: var(--color-accent); }

.hero-lede {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -.01em;
  max-width: 30ch;
  margin-bottom: 24px;
}

.hero-support {
  max-width: 52ch;
  opacity: .68;
  margin-bottom: 40px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Not flex — that would make each text node its own column. */
.availability {
  position: relative;
  padding-left: 22px;
  margin-top: 28px;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.6;
  opacity: .72;
}
.availability strong { color: var(--color-accent); font-weight: 600; }
.availability-dot {
  position: absolute;
  left: 0; top: .5em;
  width: 8px; height: 8px;
  background: var(--color-accent);
}
.hero-actions .btn-primary { min-width: 268px; }

/* Portrait */
.hero-portrait {
  justify-self: end;
  width: 100%;
  max-width: 440px;
}

.portrait {
  position: relative;
  margin: 0;
  background: var(--color-surface);
  aspect-ratio: 440 / 520;
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.04);
}
.portrait-frame {
  position: absolute;
  inset: -14px -14px 14px 14px;
  border: 1px solid var(--color-divider);
  pointer-events: none;
}
.portrait-bracket {
  position: absolute;
  top: 0; left: 0;
  width: 56px; height: 56px;
  border-top: 2px solid var(--color-accent);
  border-left: 2px solid var(--color-accent);
  z-index: 2;
  pointer-events: none;
}

.portrait-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-block: 16px;
  border-bottom: 2px solid var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.portrait-caption span:last-child { opacity: .62; text-align: right; }

/* ── "Experience in" strip ────────────────────────────────── */

.strip {
  border-top: 2px solid var(--color-divider);
  border-bottom: 2px solid var(--color-divider);
}
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px 40px;
  padding-block: 32px;
}
.strip-inner .kicker { margin: 0; flex: none; }
.strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 14px;
  font-weight: 600;
}

/* ── About ────────────────────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 72px;
  align-items: start;
}

.role-list { border-top: 2px solid var(--color-divider); }
.role-list li {
  display: flex;
  gap: 24px;
  padding-block: 22px;
  border-bottom: 1px solid var(--color-divider);
}
.role-num {
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  padding-top: 4px;
  flex: none;
}
.role-list h3 { font-size: 18px; margin-bottom: 6px; }
.role-list p { font-size: 14px; opacity: .62; line-height: 1.55; }

/* ── Experience ───────────────────────────────────────────── */

.roles-table { border-top: 2px solid var(--color-divider); }

.role-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 48px;
  padding-block: 44px;
  border-bottom: 1px solid var(--color-divider);
}

.role-dates {
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.role-org { font-size: 22px; margin-bottom: 8px; }
.role-title { font-size: 14px; opacity: .68; margin-bottom: 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 6px 12px;
  border: 1px solid var(--color-divider);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .72;
}

.bullets { margin-top: 22px; display: grid; gap: 14px; }
.bullets li {
  display: flex;
  gap: 16px;
  font-size: 15px;
  line-height: 1.6;
  opacity: .78;
}
.bullets li::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--color-accent);
  flex: none;
  margin-top: 8px;
}

/* ── Projects ─────────────────────────────────────────────── */

#projects { position: relative; overflow: hidden; }

.projects-deco {
  position: absolute;
  top: clamp(40px, 6vw, 90px);
  right: calc(var(--gutter) * -.25);
  width: 220px; height: 220px;
  border: 1px solid var(--color-divider);
  background: radial-gradient(70% 70% at 30% 30%, rgba(176, 141, 87, .10), transparent 72%);
  pointer-events: none;
}

/* The 2px gaps expose the grid's own background as gridlines, so the column
   count must always divide the 4 cards evenly — an auto-fit remainder would
   leave empty cells showing as grey slabs. */
.project-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--color-divider);
  border-block: 2px solid var(--color-divider);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-height: 320px;
  padding: 32px;
  background: var(--color-bg);
  transition: background-color .25s var(--ease);
}
.project-card:hover { background: var(--color-surface); }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.chip {
  padding: 6px 12px;
  background: rgba(176, 141, 87, .16);
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-num {
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
}

.project-bottom { margin-top: auto; }
.project-bottom h3 { font-size: 26px; margin-bottom: 14px; }
.project-bottom p { font-size: 14px; opacity: .68; line-height: 1.6; }

.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--color-divider);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.project-foot > span:first-child { opacity: .62; }
.details {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-accent);
}

/* ── Skills ───────────────────────────────────────────────── */

/* 8 skills: 4-up then 2-up, so a row is never left ragged. */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--color-divider);
}

.skill {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 28px;
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  transition: background-color .25s var(--ease);
}
.skill:hover { background: var(--color-surface); }

.skill-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--color-divider);
  color: var(--color-accent);
  margin-bottom: 24px;
  flex: none;
}
.skill h3 { font-size: 17px; margin-bottom: 10px; }
.skill p { font-size: 14px; opacity: .62; line-height: 1.55; margin-top: auto; }

/* ── Credentials ──────────────────────────────────────────── */

.credentials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 48px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 2px solid var(--color-divider);
}
.credentials[hidden] { display: none; }
.credentials-head h3 { font-size: 24px; margin-bottom: 14px; }

.badge-grid {
  grid-column: span 2;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 24px;
}
.badge { display: block; }
.badge-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  margin-bottom: 10px;
}
img.badge-img { object-fit: contain; padding: 16px; height: auto; }
.badge:hover .badge-img { background: var(--color-surface); border-color: var(--color-text); }
.badge-img { transition: background-color .25s var(--ease), border-color .25s var(--ease); }
.badge-caption { font-size: 12px; opacity: .62; }

/* ── Contact (gold field) ─────────────────────────────────── */

.contact {
  background: var(--color-accent);
  color: #141416;
  padding-block: var(--pad-y);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 64px;
  align-items: start;
}

.kicker-dark { color: #141416; opacity: .72; }

.contact-title {
  font-size: clamp(40px, 5.2vw, 72px);
  letter-spacing: -.03em;
}

.contact-links { border-top: 2px solid rgba(20, 20, 22, .3); }

.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 24px;
  border-bottom: 1px solid rgba(20, 20, 22, .3);
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 600;
  letter-spacing: -.01em;
  transition: transform .25s var(--ease);
}
.contact-link:hover { transform: translateX(8px); }

.contact-note {
  margin-top: 32px;
  max-width: 46ch;
  font-size: 14px;
  opacity: .72;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--color-divider); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px 40px;
  padding-block: 36px;
  font-size: 12px;
  letter-spacing: .06em;
}

.footer-brand { display: flex; align-items: center; gap: 14px; opacity: .72; }
.footer-line { font-weight: 600; opacity: .86; }

.footer-links { display: flex; gap: 28px; }
.footer-links a {
  font-weight: 600;
  text-transform: uppercase;
  opacity: .72;
  transition: opacity .2s var(--ease);
}
.footer-links a:hover { opacity: 1; }

/* ── Reveal animation ─────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.hero-copy > *, .hero-portrait {
  animation: rise .8s var(--ease) both;
}
.hero-kicker   { animation-delay: .00s; }
.hero-title    { animation-delay: .08s; }
.hero-lede     { animation-delay: .16s; }
.hero-support  { animation-delay: .24s; }
.hero-actions  { animation-delay: .32s; }
.hero-portrait { animation-delay: .20s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1080px) {
  .role-row { grid-template-columns: minmax(200px, 1fr) 1.6fr; gap: 32px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .site-nav { flex: 1 1 100%; order: 3; margin-inline: 0; gap: 22px; flex-wrap: wrap; }
  .header-inner { gap: 16px 24px; }
  .header-cta { margin-left: auto; }
  .hero-portrait { justify-self: start; }
}

@media (max-width: 720px) {
  .role-row { grid-template-columns: 1fr; gap: 24px; }
  .role-row .tags { order: 3; margin-top: 4px; }
  .credentials { gap: 32px; }
  .badge-grid { grid-column: auto; }
}

@media (max-width: 640px) {
  .site-nav, .header-cta { display: none; }
  .menu-toggle { display: grid; }

  .hero { padding-top: 40px; }
  .hero-grid { gap: 36px; }
  .hero-copy { display: contents; }

  .hero-kicker   { order: 1; }
  .hero-title    { order: 2; font-size: 54px; margin-bottom: 28px; }
  .hero-portrait { order: 3; max-width: none; margin-bottom: 4px; }
  .hero-lede     { order: 4; font-size: 19px; }
  .hero-support  { order: 5; margin-bottom: 28px; }
  .hero-actions  { order: 6; }
  .availability  { order: 7; margin-top: 24px; }

  .portrait { aspect-ratio: 4 / 5; }
  .portrait-frame { display: none; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; min-width: 0; }

  .strip-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .strip-list { gap: 8px; }
  .strip-list li { padding: 8px 12px; border: 1px solid var(--color-divider); font-size: 13px; }

  .about-grid { gap: 48px; }
  .project-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .skill { min-height: 170px; padding: 22px; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

  .contact-title { font-size: 40px; }
  .contact-grid { gap: 40px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-links { flex-wrap: wrap; gap: 20px; }
}

/* ── Motion / print ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .site-header, .mobile-nav, .hero-glow, .projects-deco { display: none !important; }
  body { background: #fff; color: #000; }
}
