/* Mark Noriski F. Milca — resume website
   A document viewer, not a landing page: a slim toolbar over a paper-white
   document resting on a neutral ground.

   Light and dark are both defined on :root so switching theme only swaps
   custom properties — no geometry changes, so no layout shift. */

:root {
  color-scheme: light;

  --ground:        #eceef1;   /* the area around the document */
  --paper:         #ffffff;   /* the document canvas */
  --paper-edge:    #dcdfe4;
  --chrome:        #f6f7f9;   /* toolbar */
  --chrome-edge:   #dcdfe4;
  --shadow:        0 1px 2px rgba(16, 22, 32, 0.06), 0 8px 24px rgba(16, 22, 32, 0.07);

  --text:          #16191d;
  --muted:         #4c535c;
  --faint:         #6c7683;   /* 4.61:1 on --paper (WCAG AA) */
  --accent:        #1f3a5f;
  --accent-hover:  #16304f;
  --rule:          #e4e7ec;
  --marker:        #8a94a2;
  --hover-tint:    rgba(31, 58, 95, 0.07);
  --focus:         #1f3a5f;
  --ok:            #1d6046;

  --maxw: 880px;
  --gutter: 28px;
  --pad: 56px;              /* internal document padding */
  --toolbar-h: 48px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ground:        #121519;
  --paper:         #1e2228;
  --paper-edge:    #2b3138;
  --chrome:        #191d22;
  --chrome-edge:   #2b3138;
  --shadow:        0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 26px rgba(0, 0, 0, 0.34);

  --text:          #e9edf2;
  --muted:         #adb7c3;
  --faint:         #8d97a4;
  --accent:        #8ab4e8;
  --accent-hover:  #a6c8f2;
  --rule:          #2b3138;
  --marker:        #7c8797;
  --hover-tint:    rgba(138, 180, 232, 0.12);
  --focus:         #8ab4e8;
  --ok:            #86d6b4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ground:        #121519;
    --paper:         #1e2228;
    --paper-edge:    #2b3138;
    --chrome:        #191d22;
    --chrome-edge:   #2b3138;
    --shadow:        0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 26px rgba(0, 0, 0, 0.34);

    --text:          #e9edf2;
    --muted:         #adb7c3;
    --faint:         #8d97a4;
    --accent:        #8ab4e8;
    --accent-hover:  #a6c8f2;
    --rule:          #2b3138;
    --marker:        #7c8797;
    --hover-tint:    rgba(138, 180, 232, 0.12);
    --focus:         #8ab4e8;
    --ok:            #86d6b4;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--toolbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 9px 14px;
  background: var(--accent);
  color: var(--paper);
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: top 0.15s ease;
}

:root[data-theme="dark"] .skip-link { color: #121519; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .skip-link { color: #121519; }
}

.skip-link:focus { top: 8px; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-edge);
}

.toolbar-inner {
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin: 0 auto;
  min-height: var(--toolbar-h);
  padding: 6px var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}

.doc-title {
  margin-right: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

/* The toolbar title names the document, nothing more. */

.tools {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

/* Toolbar actions are plain inline text links separated by "|" — no borders,
   no fills, no chips. Hierarchy comes from the row itself, not from styling
   any one item as a call to action. */
.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s ease;
}

.tool:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-sep {
  color: var(--paper-edge);
  font-size: 0.8125rem;
  user-select: none;
}

.tool-icon {
  width: 32px;
  padding: 0;
  margin-left: 6px;            /* sits apart from the link row, not in it */
  color: var(--faint);
}

.tool-icon:hover { text-decoration: none; }

.tool-icon .icon { width: 1rem; height: 1rem; }
.tool .icon { opacity: 0.8; }

.theme-icon-dark { display: none; }
.theme-icon-light { display: inline-flex; }

:root[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
:root[data-theme="dark"] .theme-icon-light { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline-flex; }
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
}

/* ---------- the document ---------- */

.viewport {
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}

.document {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 2px;
  box-shadow: var(--shadow);
  padding: var(--pad);
}

/* ---------- document head ---------- */

.doc-head {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--rule);
  text-align: center;             /* identity block ONLY - the body below stays
                                     ranged left, which is what recruiters scan */
}

.document section { text-align: left; }

h1 {
  margin: 0 0 5px;
  font-size: clamp(1.6rem, 1.15rem + 2vw, 2.1rem);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.tagline {
  margin: 0 0 12px;
  font-size: clamp(0.98rem, 0.94rem + 0.3vw, 1.06rem);
  font-weight: 600;
  color: var(--accent);
}

.supporting {
  margin: 0 auto 18px;
  max-width: 60ch;
  color: var(--muted);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 0.9375rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
}

.meta-sep {
  color: var(--paper-edge);
  padding: 0 2px;
  user-select: none;
}

.meta-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  color: var(--muted);
  text-decoration: none;
}

.meta-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Email and phone read as ordinary text and copy on click - no button chrome. */
.copyable {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.12s ease;
}

.copyable:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy-status {
  margin: 6px 0 0;
  min-height: 1.2em;              /* reserved: feedback never reflows the page */
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ok);
}

/* ---------- document body ---------- */

.document section { padding: 26px 0; border-top: 1px solid var(--rule); }
.document section:first-of-type { border-top: 0; }

h2 {
  margin: 0 0 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
}

h3 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Ranged left like the rest of the document. Justifying a resume paragraph
   stretches word spaces to flush both edges, which opens rivers of whitespace
   and slows down the skim-reading recruiters actually do. No separate width cap
   either: the summary shares the document's single text column. */
.summary {
  margin: 0;
  text-wrap: pretty;
}

.expertise {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px 32px;
}

.expertise-group h3 { font-size: 0.98rem; margin-bottom: 2px; }
.expertise-group p { margin: 0; color: var(--muted); }

.entry { margin-bottom: 24px; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
}

.org { font-weight: 400; color: var(--muted); }

.dates {
  margin: 0;
  color: var(--faint);
  font-size: 0.9rem;
  white-space: nowrap;
}

.context { margin: 3px 0 0; color: var(--muted); font-size: 0.9rem; }
.institution { margin: 3px 0 0; color: var(--muted); }

.bullets { margin: 9px 0 0; padding-left: 14px; list-style: none; }

.bullets li {
  margin-bottom: 6px;
  padding-left: 11px;
  text-indent: -11px;
}

.bullets li:last-child { margin-bottom: 0; }

.bullets li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--marker);
  vertical-align: 0.24em;
  margin-right: 7px;
  text-indent: 0;
}

.entry-link { margin: 9px 0 0; font-size: 0.9375rem; }

/* ---------- footer ---------- */

.site-footer {
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter) 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--paper-edge);
  font-size: 0.875rem;
  color: var(--faint);
}

.footer-name { font-weight: 600; color: var(--muted); margin-right: auto; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 20px;
}

/* Zero horizontal padding so every footer item shares one left edge with the
   name; the spacing comes from the row gap. Previously the padded copy buttons
   sat indented past the name, which is what made the mobile footer look off. */
.footer-links a,
.footer-links .copyable {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links .copyable:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root { --pad: 40px; --gutter: 20px; }
}

/* Below this the toolbar keeps only the essentials; Portfolio, LinkedIn and
   GitHub stay reachable in the footer. */
@media (max-width: 720px) {
  .toolbar-wide { display: none; }
  :root { --pad: 30px; --gutter: 14px; --toolbar-h: 56px; }

  /* Compact controls suit a mouse; a finger needs a real target. */
  .tool { min-height: 44px; padding: 5px 9px; }
  .tool-icon { width: 44px; padding: 0; margin-left: 2px; }
  .copyable, .meta-link { min-height: 44px; }

  .viewport { padding: 16px var(--gutter) 28px; }
  .document section { padding: 22px 0; }
  .doc-head { padding-bottom: 22px; }

  /* Footer: the name takes its own line, then the links sit under it in even,
     tappable rows sharing the name's left edge. */
  .footer-inner { gap: 2px 20px; }
  .footer-name { flex: 1 1 100%; margin: 0 0 2px; }
  .footer-links a,
  .footer-links .copyable { min-height: 40px; }
}

@media (max-width: 560px) {
  .meta-sep { display: none; }
  .doc-meta { gap: 0 12px; }
}

@media (max-width: 480px) {
  :root { --pad: 22px; --gutter: 10px; }

  /* On a phone the lift is what stops earning its space; the hairline frame
     still tells you where the document begins and ends. */
  .document { box-shadow: none; }

  .viewport { padding: 12px var(--gutter) 24px; }
  .tool { padding: 5px 7px; }
}

@media (min-width: 1600px) {
  :root { --gutter: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .toolbar, .skip-link, .copy-status { display: none; }
  body { background: #fff; }
  .document { border: 0; box-shadow: none; padding: 0; }
}

/* Footer copy feedback sits on its own line so it never reflows the row. */
.footer-status {
  width: 100%;
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 0.8125rem;
}
