/* jifinance.xyz — Salary ↔ Hourly Converter
   Visual identity: sky blue + sunny yellow + warm cream,
   rounded sans display, 16px rounded, bidirectional tool layout. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.6;
  color: #1f2937; background: #fffaeb;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: #2563eb; text-decoration: underline; text-decoration-color: rgba(37, 99, 235, .35); text-underline-offset: 3px; }
a:hover { color: #1e3a8a; text-decoration-color: #1e3a8a; }

h1, h2, h3, h4 {
  font-family: -apple-system, "Inter", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -.022em;
  color: #1e3a8a; line-height: 1.15; margin: 0 0 .55em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }

code, kbd, samp, .mono {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .92em; background: #fef3c7; padding: .12em .4em; border-radius: 6px;
  color: #1e3a8a;
}

:root {
  --sky: #3b82f6;
  --sky-dark: #2563eb;
  --sky-darker: #1e3a8a;
  --sky-soft: #dbeafe;
  --sun: #fbbf24;
  --sun-dark: #d97706;
  --sun-soft: #fef3c7;
  --cream: #fffaeb;
  --paper: #fef9e7;
  --line: #f0e0b6;
  --line-dim: #d6c285;
  --text: #1f2937;
  --muted: #6b7280;
  --hi: #1e3a8a;
}

.container { width: min(1080px, 92%); margin: 0 auto; }

/* ---- Header ---- */
.site-header {
  background: var(--cream);
  border-bottom: 2px solid var(--sun-soft);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; line-height: 1.1; }
.brand-mark {
  display: inline-flex; align-items: center; gap: .25rem;
  flex-shrink: 0;
}
.brand-mark .box {
  width: 18px; height: 22px; border-radius: 4px;
}
.brand-mark .box.b1 { background: var(--sky); }
.brand-mark .box.b2 { background: var(--sun); }
.brand-mark .equals {
  display: flex; flex-direction: column; gap: 3px;
}
.brand-mark .equals span {
  display: block; width: 6px; height: 3px; border-radius: 1.5px;
  background: var(--sky-darker);
}
.brand-text { display: inline-flex; flex-direction: column; gap: 1px; }
.brand-name {
  color: var(--sky-darker); font-weight: 800;
  font-size: 1.05rem; letter-spacing: -.02em;
}
.brand-tagline {
  font-size: .72rem; font-weight: 700; color: var(--sun-dark);
  letter-spacing: .03em;
}
@media (max-width: 720px) { .brand-tagline { display: none; } }

.nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; row-gap: .25rem; }
.nav a {
  font-weight: 600; color: var(--sky-darker);
  font-size: .9rem; padding: .35rem .7rem; white-space: nowrap;
  border-radius: 999px; text-decoration: none;
}
.nav a:hover { background: var(--sky-soft); color: var(--sky-dark); text-decoration: none; }
.nav-toggle {
  display: none; background: transparent; border: 0; padding: .4rem; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--sky-darker);
  margin: 5px 0;
}

/* ---- Hero ---- */
.hero {
  padding: 3.5rem 0 2.5rem;
  background:
    radial-gradient(800px 400px at 90% 20%, var(--sun-soft), transparent 60%),
    radial-gradient(900px 400px at 5% 80%, var(--sky-soft), transparent 60%),
    var(--cream);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .82rem; font-weight: 700;
  color: var(--sky-darker);
  background: var(--sun); padding: .4rem .9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 0 var(--sun-dark);
}
.lead { font-size: 1.08rem; color: var(--muted); max-width: 60ch; }

/* ---- Tool: bidirectional layout ---- */
.tool {
  background: #fff;
  border-radius: 24px;
  padding: 2rem 2rem 0;
  margin: 2rem 0;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px -16px rgba(30, 58, 138, .15);
}
.tool h2 { margin: 0 0 1.4rem; text-align: center; }
.bidir {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
}
.bidir-card {
  border-radius: 16px;
  padding: 1.4rem;
  position: relative;
}
.bidir-card.salary { background: var(--sky); color: #fff; }
.bidir-card.hourly { background: var(--sun); color: var(--sky-darker); }
.bidir-card .label {
  font-size: .75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .15em;
  margin-bottom: .8rem;
  opacity: .85;
}
.bidir-card .input-wrap {
  display: flex; align-items: baseline; gap: .4rem;
}
.bidir-card .currency {
  font-size: 1.6rem; font-weight: 700;
  opacity: .8;
}
.bidir-card input {
  font: inherit;
  background: transparent; color: inherit;
  border: none; outline: none;
  font-size: 2.4rem; font-weight: 800;
  width: 100%; padding: 0;
  letter-spacing: -.02em;
  font-family: -apple-system, "Inter", sans-serif;
}
.bidir-card input::-webkit-outer-spin-button,
.bidir-card input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bidir-card .unit {
  font-size: .85rem; opacity: .8;
  margin-top: .4rem;
  font-weight: 600;
}
.bidir-equals {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800;
  color: var(--sky-darker);
}

.tool-config {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
  padding: 1.2rem;
  background: var(--paper);
  border-radius: 12px;
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .82rem; font-weight: 700; color: var(--sky-darker); }
.field input, .field select {
  font: inherit; padding: .55rem .75rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--hi);
  font-weight: 600;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--sky-dark);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
}
.field small { color: var(--muted); font-size: .78rem; }

.tool-breakdown {
  margin: 0 -2rem;
  padding: 1.6rem 2rem;
  background: var(--sky-soft);
  border-top: 1px solid var(--line);
  border-radius: 0 0 24px 24px;
}
.tool-breakdown h3 {
  margin: 0 0 1rem; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--sky-darker); font-weight: 800;
}
.breakdown-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem;
}
.breakdown-grid .row {
  background: #fff;
  padding: .8rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--sky);
}
.breakdown-grid .row.sun { border-left-color: var(--sun-dark); }
.breakdown-grid .row .k {
  font-size: .72rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .25rem;
}
.breakdown-grid .row .v {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-weight: 700; color: var(--hi);
  font-size: 1.05rem;
}

.privacy-note {
  font-size: .85rem; color: var(--muted);
  border-left: 3px solid var(--sky);
  padding: .55rem .9rem; margin: 1.2rem 0 0;
  background: var(--cream);
  border-radius: 0 8px 8px 0;
}

/* ---- Content ---- */
.content { padding: 1.5rem 0 3rem; }
.content section { margin-bottom: 2rem; }

.author-card {
  display: grid; grid-template-columns: 92px 1fr; gap: 1.4rem;
  align-items: center; padding: 1.6rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin: 1.2rem 0;
  position: relative; overflow: hidden;
}
.author-card::before {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--sun-soft); z-index: 0;
}
.author-avatar {
  width: 92px; height: 92px; border-radius: 16px;
  background: var(--sky); color: #fff;
  font-size: 1.9rem; font-weight: 800;
  display: grid; place-items: center;
  letter-spacing: -.03em;
  position: relative; z-index: 1;
  border: 4px solid var(--sun);
}
.author-card > div:last-child { position: relative; z-index: 1; }
.author-meta { color: var(--muted); font-size: .94rem; margin: 0 0 .4rem; }
.cred-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.cred-row span {
  display: inline-block; padding: .2rem .65rem;
  background: var(--sky-soft); border: 1px solid var(--sky);
  border-radius: 999px; font-size: .76rem; color: var(--sky-darker);
  font-weight: 700;
}

/* Reference / data tables */
.ref-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
.ref-table th, .ref-table td {
  padding: .7rem .9rem; text-align: left;
  border-bottom: 1px solid var(--line);
}
.ref-table thead th {
  background: var(--sky-darker); color: var(--cream);
  font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .06em;
}
.ref-table tbody tr:nth-child(even) td { background: var(--paper); }
.ref-table tbody tr:hover td { background: var(--sun-soft); }
.ref-table td.num { font-family: "JetBrains Mono", Consolas, monospace; text-align: right; font-size: .9rem; }

.callout {
  border-left: 4px solid var(--sun-dark);
  background: var(--sun-soft);
  padding: 1rem 1.2rem; margin: 1.2rem 0;
  border-radius: 0 12px 12px 0;
  font-size: .96rem;
}
.callout strong { color: var(--sun-dark); }

/* Forms */
.form-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 1.8rem;
  margin: 1rem 0 2rem;
}
.form-card label { display: grid; gap: .35rem; margin-bottom: 1rem; font-size: .9rem; color: var(--sky-darker); font-weight: 700; }
.form-card input, .form-card textarea, .form-card select {
  font: inherit; padding: .65rem .85rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--cream);
}
.form-card input:focus, .form-card textarea:focus, .form-card select:focus {
  outline: none; border-color: var(--sky-dark);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); background: #fff;
}
.btn {
  display: inline-block; padding: .7rem 1.6rem;
  font: inherit; font-weight: 800; font-size: .95rem;
  border-radius: 999px; cursor: pointer;
  border: none; background: var(--sky-dark); color: #fff;
  box-shadow: 0 3px 0 var(--sky-darker);
}
.btn:hover { background: var(--sky-darker); }

/* Footer */
.site-footer {
  background: var(--sky-darker); color: rgba(255, 250, 235, .75);
  padding: 2.6rem 0 1.4rem;
}
.site-footer a { color: var(--sun); text-decoration: none; }
.site-footer a:hover { color: var(--cream); }
.site-footer .brand-mark .equals span { background: var(--cream); }
.site-footer .brand-name { color: var(--cream); }
.site-footer .brand-tagline { color: var(--sun); }
.footer-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 1.4rem;
}
.site-footer h4 {
  color: var(--cream); font-size: .85rem;
  margin-bottom: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; font-size: .92rem; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
  padding-top: 1.2rem; border-top: 1px solid rgba(251, 191, 36, .2);
  font-size: .84rem;
}

/* Responsive */
@media (max-width: 880px) {
  .bidir { grid-template-columns: 1fr; }
  .bidir-equals { transform: rotate(90deg); padding: .6rem 0; }
  .bidir-card input { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .author-card { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; right: 4%; left: 4%; z-index: 50;
    background: var(--cream); border: 1px solid var(--line); border-radius: 16px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .6rem; box-shadow: 0 8px 24px rgba(30, 58, 138, .15);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .65rem .9rem; }
}
