/* ==========================================================================
   Star Tax & Legal — itos.kr
   Single stylesheet. Do not add <style> blocks to individual pages.
   ========================================================================== */

:root {
  --ink:        #101a26;   /* primary text */
  --ink-soft:   #46566a;   /* secondary text */
  --ink-mute:   #6c7d90;   /* meta text */
  --paper:      #ffffff;
  --surface:    #f2f5f8;   /* light sections */
  --surface-2:  #e6ecf2;
  --rule:       #d3dce5;   /* hairlines */
  --rule-soft:  #e3eaf1;
  --accent:     #2e6fb7;   /* brand blue, used sparingly */
  --accent-dk:  #235a96;
  --deep:       #0b2545;   /* brand navy — dark band background */
  --on-deep:    #7fb0e8;   /* accent legible on navy */

  --measure: 68ch;
  --wrap: 1140px;

  --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* keep in-page anchor targets clear of the sticky header */
  scroll-padding-top: 84px;
}

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

img, iframe { max-width: 100%; }
iframe { border: 0; }

/* ---------- Links & focus ------------------------------------------------ */

a { color: var(--ink); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

/* The sticky header must not cover the open mobile panel or its overlay. */

/* ---------- Layout primitives -------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding-block: 64px; }
.section--tight { padding-block: 48px; }
.section--surface { background: var(--surface); }
.section--rule { border-top: 1px solid var(--rule-soft); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.section-head { max-width: var(--measure); margin-bottom: 34px; }

h1, h2, h3, h4 {
  font-family: var(--f-serif);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
}

h1 { font-size: 2.35rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.16rem; }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* ---------- Header -------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  padding-block: 16px;
}

/* Brand lockup — images/wm-9c.svg (navy) and wm-9c-white.svg (on navy).
   Glyphs are outlined paths, so no webfont is needed to render it. */
.brand { display: inline-block; line-height: 0; text-decoration: none; }
.brand img { display: block; width: auto; height: 34px; }
.brand--footer { margin-bottom: 26px; }
.brand--footer img { height: 30px; }

@media (min-width: 860px) {
  .brand img { height: 38px; }
  .brand--footer img { height: 32px; }
}

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

.btn {
  display: inline-block;
  padding: 13px 26px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { background: var(--accent-dk); border-color: var(--accent-dk); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn--onDeep {
  background: transparent;
  border-color: rgba(255,255,255,.55);
  color: #fff;
}
.btn--onDeep:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------- Hero ---------------------------------------------------------- */

.hero {
  background: var(--deep);
  color: #fff;
  padding-block: 88px;
  border-bottom: 3px solid var(--accent);
}
.hero h1 { color: #fff; max-width: 17ch; }
.hero .eyebrow { color: var(--on-deep); }
.hero .lead { color: rgba(255,255,255,.80); max-width: 46ch; }
.hero .btn { margin-top: 30px; }

.page-hero {
  background: var(--deep);
  color: #fff;
  border-bottom: 3px solid var(--accent);
  padding-block: 62px;
}
.page-hero h1 { color: #fff; max-width: 20ch; }
.page-hero--article h1 { max-width: 32ch; font-size: 2rem; }
.page-hero .lead { color: rgba(255,255,255,.80); }
.page-hero .eyebrow { color: var(--on-deep); }

/* ---------- Grids --------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.grid > * { background: var(--paper); }
.section--surface .grid > * { background: var(--surface); }

.grid--3 { grid-template-columns: 1fr; }
.grid--2 { grid-template-columns: 1fr; }

/* Card-like cells, flat: no shadows, hairlines only */
.cell { padding: 30px 28px; }
.cell h3 { margin-bottom: 10px; }
.cell p { color: var(--ink-soft); font-size: .97rem; }

a.cell {
  text-decoration: none;
  display: block;
  transition: background-color .18s ease;
}
a.cell:hover { background: var(--surface-2); }
a.cell .cell__more {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dk);
}

.cell__num {
  display: block;
  font-family: var(--f-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ---------- Plain list ---------------------------------------------------- */

.list-clean {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}
.list-clean li {
  padding: 13px 0 13px 20px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  position: relative;
}
.list-clean li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  width: 8px;
  border-top: 1px solid var(--accent);
}
.list-clean li:first-child { border-top: 1px solid var(--rule-soft); }

/* ---------- Article index (INSIGHTS) -------------------------------------- */

.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { border-bottom: 1px solid var(--rule-soft); }
.index-list li:first-child { border-top: 1px solid var(--rule-soft); }
.index-list a {
  display: block;
  padding: 22px 0;
  text-decoration: none;
  font-family: var(--f-serif);
  font-size: 1.14rem;
  line-height: 1.35;
  transition: color .18s ease;
}
.index-list a:hover { color: var(--accent-dk); }

/* ---------- Article ------------------------------------------------------- */

.article { max-width: var(--measure); }
.article > h2 {
  font-size: 1.5rem;
  margin: 46px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--rule-soft);
}
.article > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.article > h3 { font-size: 1.16rem; margin: 32px 0 10px; }
.article p { color: var(--ink-soft); }
.article ul {
  margin: 0 0 1em;
  padding-left: 20px;
  color: var(--ink-soft);
}
.article li { margin-bottom: 8px; }
.article a { color: var(--accent-dk); }

.article__meta {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-bottom: 0;
}
.page-hero .article__meta { color: rgba(255,255,255,.66); margin-top: 18px; }

.article__intro { font-size: 1.06rem; color: var(--ink); }

/* Pointer / caution notes carried over from the source article */
.note {
  border-left: 2px solid var(--accent);
  background: var(--surface);
  padding: 16px 20px;
  margin: 0 0 1.2em;
  max-width: var(--measure);
}
.note p { margin: 0; color: var(--ink-soft); }

.toc {
  border: 1px solid var(--rule-soft);
  padding: 26px 28px;
  margin-bottom: 44px;
  max-width: var(--measure);
}
.toc h2 { font-size: 1.16rem; margin: 0 0 18px; }
.toc h3 { font-size: 1rem; margin: 22px 0 6px; }
.toc h3:first-of-type { margin-top: 0; }
.toc p { font-size: .95rem; color: var(--ink-soft); margin-bottom: .7em; }

/* Professionals credited on an article */
.pros { display: grid; gap: 1px; background: var(--rule-soft);
        border: 1px solid var(--rule-soft); grid-template-columns: 1fr; }
.pros > * { background: var(--paper); }
.pro { display: flex; gap: 16px; align-items: center; padding: 22px 24px; }
.pro img {
  flex: none; width: 72px; height: 90px;
  object-fit: cover; object-position: top center;
  border: 1px solid var(--rule); background: var(--surface-2);
}
.pro h3 { font-size: 1.04rem; margin-bottom: 2px; }
.pro p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.pro a { color: var(--ink-soft); }

/* ---------- People -------------------------------------------------------- */

.person { padding: 30px 28px; }

.person__head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.person__photo {
  flex: none;
  width: 104px;
  height: 130px;
  object-fit: cover;
  object-position: top center;
  background: var(--surface-2);
  border: 1px solid var(--rule);
}
.person__head h3 { margin-bottom: 4px; }
.person__head .person__role { margin-bottom: 0; }

.person h3 { margin-bottom: 4px; }
.person__role {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent-dk);
  margin: 0 0 14px;
  text-transform: none;
}
.person p { font-size: .97rem; color: var(--ink-soft); }
.person ul {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: .97rem;
  color: var(--ink-soft);
}
.person li { margin-bottom: 4px; }

/* ---------- Callout band -------------------------------------------------- */

.band {
  background: var(--deep);
  color: #fff;
  padding-block: 56px;
}
.band h2 { color: #fff; }
.band .btn { margin-top: 22px; }

/* ---------- Contact page -------------------------------------------------- */

.contact-grid {
  display: grid;
  gap: 44px;
  grid-template-columns: 1fr;
  align-items: start;
}

.info-table { margin: 0; }
.info-table dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 20px;
}
.info-table dt:first-child { margin-top: 0; }
.info-table dd {
  margin: 5px 0 0;
  color: var(--ink);
}
.info-table a { color: var(--ink); }

/* Tally form: never set a height here — dynamicHeight=1 controls it. */
.form-embed { margin-top: 8px; }

.office-photo {
  margin: 0 0 26px;
  border: 1px solid var(--rule);
  line-height: 0;
}
.office-photo img { display: block; width: 100%; height: auto; }
.office-photo figcaption {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-mute);
  line-height: 1.5;
  padding: 11px 14px;
  border-top: 1px solid var(--rule-soft);
  background: var(--surface);
}

.map-embed { margin-top: 26px; border: 1px solid var(--rule); }
.map-embed iframe {
  display: block;
  width: 100%;
  height: 340px;
}

/* ---------- Footer -------------------------------------------------------- */

.site-footer {
  background: var(--deep);
  color: rgba(255,255,255,.74);
  padding-block: 52px 40px;
  font-size: .93rem;
}

.site-footer a { color: rgba(255,255,255,.86); }
.site-footer p { max-width: 72ch; }

.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,.16);
}
.footer-grid h4 {
  color: #fff;
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }

.legal {
  margin-top: 26px;
  font-size: .85rem;
  color: rgba(255,255,255,.58);
}
.legal p { margin-bottom: .6em; }

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

@media (min-width: 620px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .pros { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
}

@media (min-width: 860px) {
  body { font-size: 17px; }

  h1 { font-size: 3.05rem; }
  h2 { font-size: 2.05rem; }
  .section { padding-block: 88px; }
  .section--tight { padding-block: 62px; }
  .hero { padding-block: 128px; }
  .page-hero { padding-block: 86px; }
  .page-hero--article h1 { font-size: 2.6rem; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: 1.05fr 1fr; gap: 60px; }
  .cell { padding: 38px 34px; }
  .person { padding: 38px 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .band, .btn { display: none; }
  body { color: #000; font-size: 12pt; }
}

/* ==========================================================================
   Mobile navigation — slide-in panel
   No JavaScript. Uses <details>/<summary> so the toggle is a native focusable
   control that responds to Enter and Space.
   ========================================================================== */

.nav { margin-left: auto; }

.nav__toggle {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -10px;
}
.nav__toggle::-webkit-details-marker { display: none; }
.nav__toggle::marker { content: ""; }

.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .18s ease, opacity .18s ease;
}
.nav__toggle span::before,
.nav__toggle span::after { content: ""; position: absolute; }
.nav__toggle span::before { transform: translateY(-7px); }
.nav__toggle span::after  { transform: translateY(7px); }

.nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list a {
  display: inline-block;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav__list a:hover { color: var(--ink); }
.nav__list a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---- Panel state (small screens only) ---- */

@media (max-width: 859px) {
  .nav[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(11, 37, 69, .45);
    z-index: 55;
  }

  .nav[open] > nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(78%, 320px);
    background: var(--paper);
    border-right: 1px solid var(--rule);
    padding: 84px 28px 32px;
    overflow-y: auto;
    z-index: 60;
  }

  .nav[open] .nav__list { display: block; }
  .nav[open] .nav__list li { border-bottom: 1px solid var(--rule-soft); }
  .nav[open] .nav__list a {
    padding: 15px 0;
    display: block;
    font-size: 15px;
    letter-spacing: 0.09em;
    border-bottom: 0;
  }
  .nav[open] .nav__list a[aria-current="page"] { color: var(--ink); font-weight: 600; }

  .nav[open] .nav__toggle {
    position: fixed;
    top: 16px;
    left: 20px;
    z-index: 70;
    margin-right: 0;
  }
  .nav[open] .nav__toggle span { background: transparent; }
  .nav[open] .nav__toggle span::before { transform: rotate(45deg); background: var(--ink); }
  .nav[open] .nav__toggle span::after  { transform: rotate(-45deg); background: var(--ink); }
}

/* ---- Desktop: always show the list, hide the toggle ---- */

@media (min-width: 860px) {
  .nav__toggle { display: none; }
  /* Force the panel open regardless of the <details> state.
     ::details-content is the modern hook; display:block covers older engines. */
  .nav::details-content { content-visibility: visible; block-size: auto; }
  .nav > nav { display: block; content-visibility: visible; }
}
