/* Marino Coric — shared styles for index.html, resume.html, projects.html */

:root {
  --paper:      #FBF8F3;
  --ink:        #2B2723;
  --ink-soft:   #6B625A;
  --ink-faint:  #9A9088;
  --accent:     #A8472A;
  --rule:       #E7DFD4;
  --card:       #F6F1E9;
  /* Text that sits ON the accent. Dark mode flips it: the dark accent is a pale
     salmon, and white on it is unreadable. */
  --on-accent:  #FBF8F3;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shell: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #1B1917;
    --ink:        #EDE6DC;
    --ink-soft:   #B0A69B;
    --ink-faint:  #837a71;
    --accent:     #E79A78;
    --rule:       #332E29;
    --card:       #221F1C;
    --on-accent:  #1B1917;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  /* padding-inline only: a `padding` shorthand here would silently override the
     padding-block that main and footer set below. */
  padding-inline: 28px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: block;
  padding: 7px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .9375rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.nav a:hover { color: var(--ink); background: var(--card); }

.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--card);
  border-color: var(--rule);
}

/* ---------- page furniture ---------- */

main { padding-block: 64px 24px; }

.eyebrow {
  margin: 0 0 .625rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 .625rem;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 1.75rem;
  max-width: 36em;
}

.section-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--rule);
}

section { margin-top: 3.5rem; }

/* ---------- buttons ---------- */

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease;
}

.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary { color: var(--on-accent); background: var(--accent); }
.btn-primary:hover { filter: brightness(0.92); }

.btn-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--rule);
}
.btn-secondary:hover { background: var(--card); }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 56px;
  padding-bottom: 12px;
}

.hero-photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--rule), 0 0 0 6px var(--paper), 0 0 0 7px var(--rule);
}

.tagline {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.tagline .sep { color: var(--ink-faint); padding: 0 .45em; }

/* ---------- connect band ---------- */

.connect { margin-top: 4rem; padding-top: 2.25rem; border-top: 1px solid var(--rule); }

.connect .section-label { border-bottom: 0; padding-bottom: 0; margin-bottom: .875rem; }

/* ---------- resume ---------- */

.cv-entry { padding: 1.125rem 0; border-bottom: 1px solid var(--rule); }
.cv-entry:last-child { border-bottom: 0; }

.cv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 24px;
}

.cv-role {
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}

.cv-org { color: var(--ink-soft); font-size: .9375rem; margin: .125rem 0 0; }
.cv-dates { color: var(--ink-faint); font-size: .875rem; white-space: nowrap; }

.cv-bullets {
  margin: .75rem 0 0;
  padding-left: 1.125rem;
  color: var(--ink-soft);
  max-width: 44em;
}
.cv-bullets li { margin: .25rem 0; }

.ladder {
  list-style: none;
  margin: .875rem 0 0;
  padding: 0 0 0 1.125rem;
  border-left: 2px solid var(--rule);
}
.ladder li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1.5rem;
  padding: .25rem 0;
  font-size: .9375rem;
}
.cv-role-small { color: var(--ink); }

/* ---------- tags ---------- */

.skill-group { margin-bottom: 1.5rem; }
.skill-group:last-child { margin-bottom: 0; }

.skill-group dt {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .5rem;
}
.skill-group dd { margin: 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: .25rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-size: .875rem;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}

.card {
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
}
.card h3 {
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 400;
  margin: 0 0 .5rem;
}
.card p { margin: 0 0 .875rem; color: var(--ink-soft); font-size: .9375rem; }

.empty {
  padding: 48px 28px;
  border: 1px dashed var(--rule);
  border-radius: 14px;
  text-align: center;
  color: var(--ink-soft);
}
.empty p { margin: 0 auto; max-width: 34em; }
.empty p + p { margin-top: .75rem; font-size: .9375rem; color: var(--ink-faint); }

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

footer {
  margin-top: 5rem;
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: .8125rem;
  color: var(--ink-faint);
}

/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { width: 150px; height: 150px; order: -1; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell { padding-inline: 20px; }
  main { padding-block: 40px 16px; }
  .topbar .shell { min-height: 56px; gap: 8px; }
  .brand { font-size: 1.0625rem; }
  .nav a { padding: 6px 11px; font-size: .875rem; }
  .cv-dates { white-space: normal; }
  .cv-head, .ladder li { display: block; }
  /* both children are spans, so the dates need to be told to take their own line */
  .ladder li .cv-dates { display: block; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .actions, .ask-my-site { display: none !important; }
  main { padding-block: 0; }
  section { margin-top: 1.5rem; page-break-inside: avoid; }
  .shell { max-width: none; padding-inline: 0; }
}

/* =========================================================================
   Ask my site — chat launcher and popup panel (markup injected by
   ask-my-site.js). Styled from the tokens above, so it follows the site
   into dark mode without a second set of colours.
   ========================================================================= */

.ask-my-site {
  display: contents; /* the wrapper draws no box of its own, so page layout is untouched */
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}
/* A clean slate: whatever the site says about bare headings, lists, forms,
   inputs and buttons stops here. */
.ask-my-site :where(h2, ul, li, p, small, form, input, button) { all: revert; }
.ask-my-site, .ask-my-site * { box-sizing: border-box; }
.ask-my-site svg { display: block; flex: none; width: 22px; height: 22px; max-width: none; fill: none; stroke: currentColor; }
.ask-my-site-close svg { width: 20px; height: 20px; }

.ask-my-site-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(43, 39, 35, 0.22);
  cursor: pointer;
}
.ask-my-site-launcher:hover,
.ask-my-site-form button:hover:not(:disabled) { filter: brightness(0.92); }

.ask-my-site-panel {
  position: fixed;
  right: 20px;
  bottom: 80px; /* 20px offset + 48px button + 12px gap */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(43, 39, 35, 0.16);
}
.ask-my-site-panel[hidden] { display: none; }

.ask-my-site-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 4px 4px 16px;
  border-bottom: 1px solid var(--rule);
}
.ask-my-site-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}
.ask-my-site-close {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}
.ask-my-site-close:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.ask-my-site-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 14px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.ask-my-site-messages li {
  align-self: flex-start;
  max-width: 88%;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  background: var(--card);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.ask-my-site-messages li.ask-my-site-user {
  align-self: flex-end;
  border-color: var(--accent);
  background: transparent;
}
.ask-my-site-messages li.ask-my-site-note {
  max-width: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
}
.ask-my-site-messages li p { margin: 0; white-space: pre-wrap; }
.ask-my-site-messages li small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.ask-my-site-form {
  display: flex;
  flex: none;
  gap: 8px;
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--rule);
}
.ask-my-site-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  font: inherit;
  font-family: var(--sans);
  font-size: 16px; /* below 16px, phones zoom the page when the input is focused */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-faint);
  border-radius: 8px;
}
.ask-my-site-form input::placeholder { color: var(--ink-faint); opacity: 1; }
.ask-my-site-form button {
  flex: none;
  min-width: 64px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  cursor: pointer;
}
.ask-my-site-form button:disabled,
.ask-my-site-form input:disabled { opacity: 0.6; cursor: default; }

.ask-my-site button:focus-visible,
.ask-my-site input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ask-my-site-form input:focus-visible { outline-offset: 0; border-color: var(--accent); }
.ask-my-site-launcher:focus-visible {
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--paper), 0 2px 10px rgba(43, 39, 35, 0.22);
}

@media (max-width: 480px) {
  .ask-my-site-launcher { right: 12px; bottom: 12px; }
  .ask-my-site-panel {
    left: 8px;
    right: 8px;
    bottom: 72px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
  }
}
@media (max-width: 340px) {
  .ask-my-site-launcher { justify-content: center; width: 48px; padding: 0; }
  .ask-my-site-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ask-my-site-panel { animation: ask-my-site-open 0.16s ease-out; }
  @keyframes ask-my-site-open {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}
