/* Andrew Hart, personal site.
   LittleLink-style card: photo, name, button stack with real depth.
   Ivory paper, ink, forest, gold. Garamond display, Inter labels. */

:root {
  --ivory: #f7f4ed;
  --paper: #fffdf8;
  --paper-shade: #f6f1e6;
  --ink: #22312a;
  --ink-soft: #5c6b62;
  --forest: #2e5a48;
  --forest-deep: #24483a;
  --gold: #a17c33;
  --hairline: rgba(34, 49, 42, 0.16);
  --hairline-strong: rgba(34, 49, 42, 0.28);
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);

  /* Brand badges */
  --brand-linkedin: #2867b2;
  --brand-aet: #b8862f;
  --brand-accuplan: #b11b26;
  --brand-tep: #1c3f5e;
  --brand-ctfa: #2e5a48;
}

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

html { height: 100%; }

body {
  height: 100svh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Gradient pinned to the viewport: never shifts or stops when the
   contact form opens and the page grows. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(130% 110% at 50% 0%, #fcf9f3 0%, var(--ivory) 42%, #eee8d8 100%);
}

::selection { background: rgba(161, 124, 51, 0.24); }

a { color: var(--forest); text-decoration: underline; text-decoration-color: rgba(46, 90, 72, 0.4); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--gold); }

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

/* ---------- Card ---------- */

.sheet {
  width: min(430px, 92vw);
  max-height: calc(100svh - 36px);
  overflow-x: clip;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(1rem, 3vh, 2rem) 0;
}

/* ---------- Who ---------- */

.who {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
  box-shadow:
    0 0 0 5px var(--ivory),
    0 0 0 6px var(--hairline),
    0 30px 52px -36px rgba(34, 49, 42, 0.6);
}

.name {
  margin-top: 1.8rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 7vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

/* Credentials: same Garamond as the name, smaller and gold. */
.creds {
  font-family: var(--serif);
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gold);
  white-space: nowrap;
}

.kicker {
  margin-top: 0.55rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Sections ---------- */

.block {
  width: 100%;
  margin-top: 1.6rem;
  text-align: left;
}

.block-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  padding-inline: 0.35rem;
  margin-bottom: 0.6rem;
}

/* ---------- Buttons ---------- */

.links {
  width: 100%;
  display: grid;
  gap: 0.75rem;
}

.button {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 58px;
  padding: 0.7rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
  /* Depth: paper gradient, hairline, resting shadow. */
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-shade) 100%);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(34, 49, 42, 0.05),
    0 14px 26px -20px rgba(34, 49, 42, 0.5);
  cursor: pointer;
  transition:
    transform 0.24s var(--ease),
    box-shadow 0.24s var(--ease),
    border-color 0.24s,
    background 0.24s;
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-strong);
  box-shadow:
    0 2px 3px rgba(34, 49, 42, 0.06),
    0 22px 34px -22px rgba(34, 49, 42, 0.6);
}

.button:active {
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(34, 49, 42, 0.08),
    0 8px 16px -14px rgba(34, 49, 42, 0.5);
}

.button:focus-visible { outline-offset: 2px; }

/* ---------- Badges: one per brand, no re-use ---------- */

.badge {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: #fffdf8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.24s var(--ease);
}

.button:hover .badge { transform: scale(1.06); }

.badge .icon {
  width: 17px;
  height: 17px;
  display: block;
}

/* LinkedIn blue */
.badge-linkedin  { background: linear-gradient(180deg, #3274c2 0%, var(--brand-linkedin) 100%); }

/* Real favicon marks: image fills the badge, no chip, no shadow */
.badge-mark {
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}
.badge-mark .icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* STEP: their navy, white Garamond letters */
.badge-tep       { background: linear-gradient(180deg, #232c55 0%, #1a2154 100%); font-size: 10.5px; }

/* ABA: deep logo blue, white Garamond letters */
.badge-aba {
  background: linear-gradient(180deg, #1d5c90 0%, #123f66 100%);
  color: #ffffff;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -2px 4px rgba(0, 0, 0, 0.28);
}

.badge-mail      { background: linear-gradient(180deg, #356a54 0%, var(--forest) 100%); }
.badge-hksons    { background: linear-gradient(180deg, #262626 0%, #000 100%); }

/* Label and arrow */

.label {
  flex: 1 1 0;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Never let arrows push width: they can shrink */
.arrow { flex: 0 0 auto; min-width: 0; }

.arrow {
  flex: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(34, 49, 42, 0.45);
  transition: transform 0.24s var(--ease), color 0.24s;
}

.button:hover .arrow { transform: translateX(3px); color: var(--ink); }
.button-toggle[aria-expanded="true"] .arrow { transform: rotate(180deg); color: var(--forest); }

/* Open contact: pressed-in card */
.button-toggle[aria-expanded="true"] {
  transform: none;
  background: linear-gradient(180deg, var(--paper-shade) 0%, #f0eadd 100%);
  border-color: rgba(46, 90, 72, 0.4);
  box-shadow:
    inset 0 2px 5px rgba(34, 49, 42, 0.09),
    0 1px 2px rgba(34, 49, 42, 0.06);
}

/* Contact open: let the page scroll; no inner scrollbar */
body.form-open {
  height: auto;
  min-height: 100svh;
  overflow: auto;
}
body.form-open .sheet {
  max-height: none;
  overflow: visible;
}

/* ---------- Form ---------- */

.contact-form {
  width: 100%;
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
  text-align: left;
}

.contact-form[hidden] { display: none; }

.field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  box-shadow: inset 0 2px 4px rgba(34, 49, 42, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea { resize: none; min-height: 4.6rem; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: inset 0 2px 4px rgba(34, 49, 42, 0.05), 0 0 0 3px rgba(46, 90, 72, 0.13);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.actions .button { width: auto; padding-inline: 2.4rem; }
.button-send { color: #fffdf8; background: linear-gradient(180deg, #356a54 0%, var(--forest-deep) 100%); border-color: var(--forest-deep); }
.button-send:hover { background: linear-gradient(180deg, #2e5f4a 0%, #1e3d31 100%); }

.form-status { font-size: 0.95rem; color: var(--ink-soft); }
.form-status.ok { color: var(--forest); }
.form-status.err { color: #8a3b2e; }

/* ---------- Motion ---------- */

.anim { animation: rise 0.9s var(--ease) both; }
.d01 { animation-delay: 0.05s; }
.d02 { animation-delay: 0.18s; }
.d03 { animation-delay: 0.32s; }

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

@media (prefers-reduced-motion: reduce) {
  .anim { animation: none; }
  .button:hover, .button:hover .badge { transform: none; }
  .button:hover .arrow, .button-toggle[aria-expanded="true"] .arrow { transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  body { height: auto; min-height: 100svh; overflow: auto; }
  /* Natural page scroll on phones: never a scroll-in-a-box. */
  .sheet {
    padding: clamp(1.8rem, 6vh, 2.8rem) 0 2.5rem;
    max-height: none;
    overflow: visible;
  }
  .avatar { width: 168px; height: 168px; }
  .name { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .button { min-height: 52px; padding: 0.7rem 1rem; }
  .badge { width: 36px; height: 36px; }
}

@media (max-height: 700px) and (min-width: 641px) {
  body { height: auto; overflow: auto; }
  .avatar { width: 150px; height: 150px; }
  .name { margin-top: 1.2rem; }
  .links { margin-top: 1.4rem; }
}