/* danielcoelho.pt — direction: Type and nothing else · Chivo · Charcoal and primaries */

:root {
  --bg: #191919;
  --surface: #242424;
  --ink: #ffffff;
  --muted: #a3a3a3;
  --accent: #0c7866;
  --accent-ink: #ffffff;
  --red: #d71e1e;
  --blue: #1e4bd7;
  --teal: #0c7866;
  --yellow: #ffe927;
  --dark: #111111;
  --paper: #ffffff;

  --font: "Chivo", "Helvetica Neue", Arial, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
  --step-display: clamp(4rem, 13.5vw, 15rem);

  --margin: clamp(1rem, 2.2vw, 2rem);
  --section: clamp(6rem, 13vw, 13rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--step-body); line-height: 1.4; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
a { color: inherit; }
:target { scroll-margin-top: 2rem; }
::selection { background: var(--yellow); color: var(--dark); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.contact :focus-visible, .field-yellow :focus-visible { outline-color: var(--blue); }

.wrap { padding-inline: var(--margin); }
.nums { font-variant-numeric: tabular-nums; }
.only-wide { display: none; }
@media (min-width: 48em) { .only-wide { display: inline; } }

.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; transition: text-decoration-color var(--t-hover) ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; transition: opacity var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; }
  .link-plain:hover { opacity: 0.7; }
}

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.25rem; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease; }
.button:active { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .button:hover { background: var(--yellow); color: var(--dark); } }

/* ---------- hero: waterline headline ---------- */
.hero { position: relative; height: 100svh; min-height: 34rem; overflow: hidden; --seam: 50%; }
.hero-water { position: absolute; left: 0; right: 0; top: var(--seam); bottom: 0; background: var(--blue); }
.hero-title { position: absolute; z-index: 1; left: 0; right: 0; top: var(--seam); margin: -1.32em 0 0; text-align: center; color: var(--yellow); font-size: var(--step-display); font-weight: 900; line-height: 0.88; letter-spacing: -0.05em; text-transform: uppercase; white-space: nowrap; }
.lines .line { display: block; overflow: hidden; }
.lines [data-line] { display: block; position: relative; }
.hero-title [data-under]::after { content: attr(data-under); position: absolute; inset: 0; color: var(--paper); clip-path: inset(50% -1em -1em -1em); }

.hero-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: var(--margin); }
.wordmark { font-weight: 900; text-transform: uppercase; letter-spacing: -0.03em; font-size: var(--step-lead); text-decoration: none; line-height: 1; }
.hero-links { display: flex; align-items: center; gap: 1.75rem; font-weight: 700; }

.hero-sub { position: absolute; z-index: 1; left: 0; right: 0; margin-inline: auto; top: calc(var(--seam) + var(--step-display) * 0.44 + 2.25rem); width: min(36rem, 100% - 2 * var(--margin)); text-align: center; font-size: var(--step-lead); line-height: 1.3; color: var(--paper); text-wrap: balance; }
.hero-foot { position: absolute; z-index: 1; left: var(--margin); right: var(--margin); bottom: var(--margin); display: flex; justify-content: space-between; font-weight: 700; color: var(--paper); }

/* ---------- about: side facts, wide paragraph ---------- */
.about { padding-block: var(--section) 0; }
.about-row { display: grid; grid-template-columns: 34% minmax(0, 1fr); align-items: start; }
.side-title { font-size: var(--step-body); font-weight: 700; line-height: 1.3; }
.about-side { padding-right: 2rem; }
.facts { margin-top: 1.75rem; display: grid; gap: 1.25rem; max-width: 17rem; }
.facts dt { color: var(--muted); font-size: var(--step-small); }
.facts dd { font-size: var(--step-body); line-height: 1.3; }
.about-lead { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.02em; max-width: 52ch; text-wrap: pretty; }
.about-help { margin-top: clamp(5rem, 9vw, 8.5rem); grid-template-columns: 34% minmax(0, 1fr) minmax(0, 1fr); column-gap: 0; }
.help-list { display: grid; gap: 0.7rem; padding-right: 2rem; align-content: start; }
.help-list li { line-height: 1.3; }

/* ---------- work: quiet ledger, side detail ---------- */
.work { padding-block: var(--section) 0; display: grid; grid-template-columns: 22% minmax(0, 1fr); align-items: start; }
.work-title { font-size: var(--step-head); font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.88; grid-column: 1 / -1; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.ledger { grid-column: 2; position: relative; --col: min(38rem, 52%); }
.role-row { display: grid; grid-template-columns: 42% minmax(0, 1fr) auto; column-gap: 1rem; align-items: baseline; width: var(--col); min-height: 3rem; padding-block: 0.6rem; text-align: left; transition: color var(--t-hover) ease, transform var(--t-ui) var(--ease-out); }
.role-name { font-weight: 700; }
.role-kind { color: var(--muted); font-size: var(--step-small); transition: color var(--t-hover) ease; }
.role-year { color: var(--muted); font-size: var(--step-small); text-align: right; white-space: nowrap; transition: color var(--t-hover) ease; }
.role-detail { padding: 0.75rem 0 1.75rem; max-width: 34rem; }
.role-detail p { line-height: 1.4; }
.role-detail ul { margin-top: 0.9rem; display: grid; gap: 0.55rem; }
.role-detail li { padding-left: 1.4rem; position: relative; line-height: 1.35; }
.role-detail li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.5rem; height: 0.5rem; background: var(--yellow); }
.role-detail > a { display: inline-block; margin-top: 1rem; font-weight: 700; }

.js .role-detail { display: none; }
.js .role.is-active .role-detail { display: block; }
.js .ledger .role-row { color: var(--muted); }
.js .ledger .role.is-active .role-row { color: var(--ink); }
.js .ledger .role.is-active .role-kind, .js .ledger .role.is-active .role-year { color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .js .ledger .role-row:hover { color: var(--ink); } }

@media (min-width: 62em) {
  .js .ledger { min-height: 31rem; }
  .js .ledger .role.is-active .role-row { transform: translateX(0.75rem); }
  .js .role-detail { position: absolute; top: 0; left: calc(var(--col) + 4rem); right: 0; max-width: none; padding: 2rem; background: var(--surface); }
  .js .role.is-active .role-detail { animation: detail-in 320ms var(--ease-out) both; }
  .role-detail p:first-child { font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.02em; }
}
@keyframes detail-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- AI skills: statements on colour fields ---------- */
.ai { margin-top: var(--section); }
.field { min-height: clamp(22rem, 52vw, 76svh); padding: var(--margin); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: var(--margin); row-gap: 3rem; }
.field-red { background: var(--red); color: var(--paper); }
.field-yellow { background: var(--yellow); color: var(--dark); }
.field-blue { background: var(--blue); color: var(--paper); }
.field-teal { background: var(--teal); color: var(--paper); }
.field-text { grid-column: 8 / -1; max-width: 30ch; font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.02em; padding-top: 1rem; }
.field-phrase { grid-column: 1 / -1; align-self: end; font-size: clamp(3.25rem, 9.6vw, 10.5rem); font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.88; white-space: nowrap; }
.field.is-mirrored .field-text { grid-column: 1 / 7; }
.field.is-mirrored .field-phrase { text-align: right; }

/* ---------- Braga ---------- */
.braga { margin: 0; }
.braga-frame { height: min(92svh, 62vw); overflow: hidden; }
.braga-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.braga figcaption { padding-top: 1rem; font-size: var(--step-body); display: grid; grid-template-columns: 34% minmax(0, 1fr); row-gap: 0.25rem; }
@media (max-width: 40em) { .braga figcaption { grid-template-columns: 1fr; } }

/* ---------- made: line-up at one type size ---------- */
.made { padding-block: var(--section); }
.made-head { font-size: var(--step-lead); font-weight: 400; line-height: 1.5; letter-spacing: -0.02em; color: var(--yellow); margin-bottom: 1.25rem; }
.lineup { font-size: var(--step-lead); line-height: 1.5; letter-spacing: -0.02em; }
.lineup li { display: grid; column-gap: 1.5rem; align-items: baseline; }
.lineup-4 li { grid-template-columns: 33% minmax(0, 1fr) 5.5ch 5.5ch; }
.lineup-4 li > :nth-child(2), .lineup-2 li > :nth-child(2) { color: var(--muted); }
.lineup-4 li > :nth-child(4) { text-align: right; }
.lineup-2 li { grid-template-columns: 33% minmax(0, 1fr); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--margin); margin-top: clamp(4.5rem, 8vw, 7.5rem); }
.trio-frame { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface); }
.trio-frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-soft); }
@media (hover: hover) and (pointer: fine) { .trio figure:hover img { transform: scale(1.05); } }
.trio figcaption { padding-top: 0.75rem; font-size: var(--step-body); }

/* ---------- contact: the email as display type ---------- */
.contact { background: var(--paper); color: var(--dark); min-height: 84svh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; padding-block: var(--margin); }
.contact-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem var(--margin); padding-top: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.contact-ask { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.02em; max-width: 18ch; }
.contact-ask strong { font-weight: 900; }
.topics { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.topic { min-height: 2.75rem; padding: 0 1.1rem; background: #ebebeb; color: var(--dark); font-weight: 700; transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.topic:active { transform: scale(0.96); }
.topic[aria-pressed="true"] { background: var(--dark); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .topic:not([aria-pressed="true"]):hover { background: var(--yellow); } }
.contact-mail { align-self: end; font-size: 6.6vw; font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.88; padding-block: 3rem 5vh; white-space: nowrap; }
.contact-mail a { display: inline-block; text-decoration: none; transition: color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .contact-mail a:hover { color: var(--blue); } }
.contact-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 700; }
.contact-social { display: flex; gap: 1.5rem; }

/* ---------- footer: name first ---------- */
.footer { background: var(--red); color: var(--paper); padding-block: clamp(2.5rem, 5vw, 4.5rem) var(--margin); }
.footer-name { font-size: 10vw; font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.88; white-space: nowrap; }
.footer-name span { display: inline-block; }
.footer-row { display: grid; grid-template-columns: 5fr 7fr; gap: 3rem var(--margin); margin-top: 4.5rem; align-items: start; }
.footer-places { font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.footer-cols { display: grid; grid-template-columns: 1fr 1.2fr 2fr; gap: 2rem var(--margin); }
.footer-cols ul { display: grid; gap: 0.5rem; align-content: start; }
.footer-credits { font-size: var(--step-small); line-height: 1.45; }
.footer-legal { display: flex; justify-content: space-between; gap: 1rem; margin-top: clamp(3.5rem, 7vw, 6rem); font-size: var(--step-small); }

/* ---------- narrow screens ---------- */
@media (max-width: 61.99em) {
  .about-row { grid-template-columns: 1fr; }
  .about-side { order: 2; margin-top: 3rem; padding-right: 0; }
  .facts { grid-template-columns: 1fr 1fr; max-width: none; gap: 1.5rem 1.25rem; }
  .about-help { grid-template-columns: 1fr 1fr; row-gap: 1.5rem; }
  .about-help .side-title { grid-column: 1 / -1; }
  .work { grid-template-columns: 1fr; }
  .ledger { grid-column: 1; --col: 100%; }
  .field-text { grid-column: 6 / -1; }
  .field.is-mirrored .field-text { grid-column: 1 / 8; }
  .footer-row { grid-template-columns: 1fr; }
}
@media (max-width: 40em) {
  :root { --step-display: 16.5vw; }
  .hero-sub { margin-inline: var(--margin); text-align: left; font-size: 1.125rem; top: calc(var(--seam) + var(--step-display) * 0.44 + 1.75rem); }
  .hero-foot { font-size: var(--step-small); }
  .about-help { grid-template-columns: 1fr; }
  .help-list { padding-right: 0; }
  .role-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.1rem; min-height: 3.25rem; }
  .role-kind { grid-column: 1; grid-row: 2; font-size: var(--step-small); }
  .role-year { grid-column: 2; grid-row: 1; }
  .field { min-height: 56svh; }
  .field-text, .field.is-mirrored .field-text { grid-column: 1 / -1; max-width: 80%; font-size: 1.0625rem; }
  .field.is-mirrored .field-text { justify-self: end; }
  .field.is-mirrored .field-phrase { text-align: left; }
  .field-phrase { font-size: 12.6vw; }
  .braga-frame { height: 70svh; }
  .lineup { line-height: 1.3; }
  .lineup li { grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 0.75rem; margin-bottom: 1.1rem; }
  .lineup li > :first-child { grid-column: 1 / -1; }
  .lineup li > :not(:first-child) { font-size: var(--step-small); color: var(--muted); }
  .lineup-2 li { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr; }
  .contact { min-height: 80svh; }
  .contact-top { grid-template-columns: 1fr; }
  .contact-mail { font-size: 8.4vw; white-space: normal; }
  .contact-mail a span { display: block; }
  .contact-foot { flex-direction: column; gap: 0.75rem; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-credits { grid-column: 1 / -1; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js [data-rise] { opacity: 0; animation: rise 800ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 420ms); }
  .js .lines [data-line] { transform: translateY(105%); animation: line 950ms var(--ease-expo) forwards; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-expo); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .lineup li[data-reveal] { transform: translateY(14px); transition-duration: 500ms, 600ms; }
  .braga-frame img { animation: drift 26s var(--ease-soft) infinite alternate; }
}
@keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes line { to { transform: none; } }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.12) translateY(-1.5%); } }
