/* Brian Tramuel portfolio
   look: cool steel paper, navy ink, teal for "granted", amber for "in progress".
   one font for everything, mono only where it's literally directory syntax. */

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

:root {
  --paper:   #f1f3f6;
  --surface: #ffffff;
  --ink:     #14203a;
  --ink-2:   #46526b;
  --ink-3:   #6b7690;
  --rule:    #d4dae4;
  --accent:  #0d7a64;
  --accent-soft: #dcefe9;
  --pending: #9a5800;
  --pending-soft: #f6ead8;

  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;

  --max: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --label-col: 13rem;

  color-scheme: light;
}

/* dark: follows the OS unless the toggle forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #0f1522;
    --surface: #161f31;
    --ink:     #e7ecf4;
    --ink-2:   #b3bdd0;
    --ink-3:   #8591a8;
    --rule:    #263249;
    --accent:  #4fcfb1;
    --accent-soft: #15362f;
    --pending: #e6a541;
    --pending-soft: #3a2c14;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper:   #0f1522;
  --surface: #161f31;
  --ink:     #e7ecf4;
  --ink-2:   #b3bdd0;
  --ink-3:   #8591a8;
  --rule:    #263249;
  --accent:  #4fcfb1;
  --accent-soft: #15362f;
  --pending: #e6a541;
  --pending-soft: #3a2c14;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--paper); }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.8rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 2rem;
}
.wordmark {
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.nav a {
  text-decoration: none;
  color: var(--ink-2);
}
.nav a:hover { color: var(--ink); }
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.btn-small {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
}
.btn-small:hover { background: var(--ink); color: var(--paper); }
.theme-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }
/* show the icon for the theme you'd switch TO */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
  padding-top: clamp(3.5rem, 9vw, 7rem);
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}
.hero-name {
  font-size: clamp(3.4rem, 10vw, 7.5rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.045em;
  margin-bottom: 1.75rem;
}
.hero-lede {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34rem;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.75rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* the AD properties card. this is the one loud thing on the page */
.record {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.8rem;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(20, 32, 58, 0.35);
}
.record-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-weight: 500;
}
.record-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
}
.record-list { padding: 0.4rem 0; }
.rec {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.42rem 1rem;
}
.rec dt { color: var(--ink-3); }
.rec dd { color: var(--ink); overflow-wrap: anywhere; }
.rec-status {
  margin-top: 0.35rem;
  background: var(--accent-soft);
}
.rec-status dd { color: var(--accent); font-weight: 500; }

/* one load moment: attribute rows come in one by one */
@media (prefers-reduced-motion: no-preference) {
  .rec {
    opacity: 0;
    animation: rec-in 0.35s ease-out forwards;
  }
  .rec:nth-child(1) { animation-delay: 0.15s; }
  .rec:nth-child(2) { animation-delay: 0.27s; }
  .rec:nth-child(3) { animation-delay: 0.39s; }
  .rec:nth-child(4) { animation-delay: 0.51s; }
  .rec:nth-child(5) { animation-delay: 0.63s; }
  .rec:nth-child(6) { animation-delay: 0.85s; }
}
@keyframes rec-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- sections: title column on the left, content on the right ---------- */

.section {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  gap: 2.5rem;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  /* rule only as wide as the content, not the padding */
  background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  align-self: start;
  position: sticky;
  top: 5rem;
}
.section-body { min-width: 0; }

h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }

/* ---------- about ---------- */

.about {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2.25rem;
  align-items: start;
}
.about-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 10px;
}
.prose { max-width: 38rem; }
.prose p { color: var(--ink-2); margin-bottom: 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- experience ---------- */

.job {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.job:first-child { padding-top: 0; }
.job:last-child { border-bottom: 0; padding-bottom: 0; }
.job-when, .school-when {
  font-size: 0.9rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}
.job-where { color: var(--ink-3); font-size: 0.95rem; margin: 0.15rem 0 0.6rem; }
.job-what > p:not(.job-where) { color: var(--ink-2); max-width: 40rem; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.tags li {
  font-size: 0.8rem;
  color: var(--ink-2);
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

/* ---------- projects ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 2rem;
}
.filter {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.filter:hover { border-color: var(--ink-3); color: var(--ink); }
.filter.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.projects { display: grid; gap: 0; }

.proj {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.proj:first-child { padding-top: 0; }
.proj:last-child { border-bottom: 0; }

/* featured ones get a panel so the security work leads */
.proj.is-featured {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 1.5rem 1.6rem;
  margin-bottom: 1rem;
}
.proj.is-featured + .proj:not(.is-featured) { padding-top: 1rem; }

.proj-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.4rem;
}
.proj-title { font-size: 1.2rem; }
.proj.is-featured .proj-title { font-size: 1.35rem; }
.proj-date { font-size: 0.9rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.proj-desc { color: var(--ink-2); max-width: 44rem; }
.proj-stack { font-size: 0.9rem; color: var(--ink-3); margin-top: 0.6rem; }
.proj-learned {
  margin-top: 0.75rem;
  color: var(--ink-2);
  max-width: 44rem;
  font-size: 0.97rem;
}
.proj-learned strong { color: var(--ink); font-weight: 600; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: 0.15em;
  background: var(--pending-soft);
  color: var(--pending);
}

.proj-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 0.85rem; }
.proj-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.proj-links a:hover { text-decoration-thickness: 2px; }

.empty { color: var(--ink-3); }

/* ---------- skills ---------- */

.skill-row {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.skill-row:first-child { padding-top: 0; }
.skill-row:last-child { border-bottom: 0; }
.skill-row dt { font-weight: 600; }
.skill-row dd { color: var(--ink-2); max-width: 40rem; }

/* ---------- education + certs ---------- */

.school {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.school:first-child { padding-top: 0; }
.school-where { color: var(--ink-3); font-size: 0.95rem; margin-top: 0.15rem; }
.school-note { color: var(--ink-2); margin-top: 0.6rem; max-width: 40rem; }

.sub-title { margin-top: 2.75rem; font-size: 1.15rem; }
.sub-lede { color: var(--ink-3); font-size: 0.95rem; margin: 0.2rem 0 1.1rem; }

/* certs really are a sequence, so they get numbers */
.certs { counter-reset: cert; }
.cert {
  counter-increment: cert;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--rule);
}
.cert:last-child { border-bottom: 0; }
.cert::before {
  content: counter(cert);
  font-weight: 700;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.cert-name { font-weight: 500; }
.cert-state { font-size: 0.85rem; color: var(--ink-3); white-space: nowrap; }
.cert.is-active::before { color: var(--pending); }
.cert.is-active .cert-state {
  font-weight: 600;
  color: var(--pending);
  background: var(--pending-soft);
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
}

/* ---------- involvement ---------- */

.involve {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.inv-when { font-size: 0.9rem; color: var(--ink-3); margin: 0.2rem 0 0.6rem; }
.inv p:last-child { color: var(--ink-2); font-size: 0.98rem; }

/* ---------- contact ---------- */

.contact-lede {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 30rem;
  margin-bottom: 2rem;
}
.c-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.c-row:last-child { border-bottom: 0; }
.c-row dt { color: var(--ink-3); }
.c-row a {
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.2s ease;
}
.c-row a:hover { background-size: 100% 2px; }

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

.footer {
  padding-top: 2rem;
  padding-bottom: 3rem;
  background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  color: var(--ink-3);
  font-size: 0.9rem;
}

/* ---------- smaller screens ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .section { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 3.25rem; padding-bottom: 3.25rem; }
  .section-title { position: static; }
  .involve { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 1rem;
    font-size: 0.9rem;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  html { scroll-padding-top: 7rem; }

  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 15rem; }

  .job, .school, .skill-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .rec { grid-template-columns: 1fr; gap: 0.1rem; }
  .cert { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .cert-state { grid-column: 2; justify-self: start; }
  .c-row { grid-template-columns: 6rem minmax(0, 1fr); }
  .proj.is-featured { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .c-row a { transition: none; }
}
