/* akhan.me: An Atlas of Small Worlds. Light only: the parchment is the identity. */

@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond.woff2") format("woff2"); font-weight: 400 500; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/fonts/eb-garamond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("/fonts/im-fell-english.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("/fonts/im-fell-english-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("/fonts/im-fell-english-sc.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ground: #E9DFC8;
  --paper: #EFE5CF;
  --ink: #2A2620;
  --muted: #5B5246;
  --accent: #9E3B24;
  --accent-deep: #6E2615;
  --coast: #8FA3A6;
  --land: #E0CFA6;
  --land-wip: #EAE0C6;
  --grat: #D3C49E;
  --rhumb: #CDBD94;
  --dots: #8C7F6A;
  --edge: #B7A880;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --fell: "IM Fell English", Georgia, serif;
  --fell-sc: "IM Fell English SC", Georgia, serif;
  --fade: 150ms;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 18px/1.55 var(--serif); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
.sc { font-family: var(--fell-sc); letter-spacing: .12em; }
.kicker { font-size: 15px; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 16px; top: -100px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 10; }
.skip:focus { top: 12px; color: var(--paper); }

.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 56px; display: flex; flex-direction: column; gap: 40px; }
main { display: flex; flex-direction: column; gap: 48px; }

/* Buttons and link-buttons */
.btn { font: 400 16px/1 var(--serif); background: transparent; border: 1px solid var(--ink); color: var(--ink); padding: 9px 16px; min-height: 44px; cursor: pointer; border-radius: 2px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--ink); color: var(--paper); }
.lnk { background: none; border: 0; padding: 0; font: inherit; font-size: 16px; color: var(--accent); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.lnk:hover { color: var(--accent-deep); }

/* Header */
.masthead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.wordmark { font-size: 19px; color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.wordmark:hover { color: var(--accent); }
.doors { display: flex; gap: 4px 20px; align-items: center; flex-wrap: wrap; font-size: 17px; }
.doors a { min-height: 44px; display: inline-flex; align-items: center; }
.toggle { padding: 6px 12px; font-size: 15px; }
.toggle { display: none; }
.js .toggle { display: inline-flex; }

/* Title page */
.title-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 0 0; }
.byline { font: italic 400 18px/1.3 var(--fell); color: var(--muted); }
.title-page h1 { font: 400 64px/1 var(--fell); }
.place { font-size: 13px; color: var(--muted); }
.rule { width: 80px; border: 0; border-top: 1px solid var(--ink); margin: 10px 0; }
.intro { max-width: 640px; font-size: 20px; line-height: 1.55; }
.hint { font-size: 16px; font-style: italic; color: var(--muted); }
.down { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 22px; text-decoration: none; border-radius: 50%; }
.down:hover { background: var(--paper); }

/* Atlas layout */
.atlas { display: flex; flex-direction: column; gap: 24px; scroll-margin-top: 12px; }
.atlas-app { display: none; }
.js .atlas-app { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.js .atlas.is-plain .atlas-app { display: none; }
.contents-col { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.view { flex: 999 1 600px; min-width: 0; }
/* Hold the space the script will fill, so nothing below jumps when the atlas renders. */
.js #contents:empty { min-height: 362px; }
.js #atlas-view:empty { aspect-ratio: 1000 / 620; margin: 6px 6px 54px; }
.js .bottle-q p:empty::before { content: "\00a0"; }
.view.fade { animation: fade var(--fade) ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Contents */
.contents-title { font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.cbtn { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; width: 100%; border-bottom: 1px dotted var(--dots); padding: 10px 0; text-decoration: none; font-size: 18px; color: var(--ink); min-height: 44px; }
.cbtn:hover, .cbtn[aria-current="true"] { color: var(--accent); }
.cbtn .n { font-family: var(--fell-sc); font-size: 15px; color: var(--muted); }
.cbtn .c { font-style: italic; font-size: 14px; color: var(--muted); text-align: right; }

/* Bottle */
.bottle { background: var(--paper); border: 1px solid var(--edge); padding: 16px 16px 6px; display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.bottle-title { font-size: 12px; color: var(--muted); }
.bottle-q { margin: 0; font: italic 400 20px/1.3 var(--fell); }
.bottle-s { font-size: 14px; color: var(--muted); }
.bottle .lnk { font-size: 14px; }

/* Chart frame shared by the general chart and plates */
.frame { position: relative; background: var(--paper); border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 5px; margin: 6px; }
.frame > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.grat { stroke: var(--grat); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.grat.fine { stroke-width: .6; }
.rhumb { stroke: var(--rhumb); stroke-width: .7; fill: none; vector-effect: non-scaling-stroke; }
.land { fill: var(--land); stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.land.wip { fill: var(--land-wip); stroke-dasharray: 3 4; }
.shore { fill: none; stroke: var(--coast); stroke-width: .8; vector-effect: non-scaling-stroke; }
.rose { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rose-f { fill: var(--ink); }

.cartouche { position: absolute; left: 3%; top: 5%; padding: 10px 14px; background: var(--paper); border: 1px solid var(--ink); text-align: center; line-height: 1.25; }
.cartouche .sc { font-size: 14px; display: block; }
.cartouche i { font-size: 13px; color: var(--muted); }

.isle { position: absolute; transform: translate(-50%, -50%); background: rgba(239, 229, 207, .9); border: 1px solid var(--ink); padding: 7px 12px 6px; text-align: center; font: 400 17px/1.1 var(--fell-sc); letter-spacing: .12em; color: var(--ink); text-decoration: none; min-height: 44px; z-index: 2; max-width: 30%; display: flex; flex-direction: column; justify-content: center; }
.isle small { display: block; font: italic 400 13px/1.25 var(--serif); letter-spacing: 0; color: var(--muted); margin-top: 3px; }
.isle .count { font-size: 12px; margin-top: 1px; }
.isle:hover, .isle:focus-visible { background: var(--ink); color: var(--paper); }
.isle:hover small, .isle:focus-visible small { color: #D9CBAA; }

.port { position: absolute; transform: translate(-50%, -50%); font: italic 400 15px/1 var(--fell); color: var(--accent); white-space: nowrap; display: flex; align-items: center; gap: 6px; text-decoration: none; min-height: 44px; padding: 0 4px; }
.port i { display: block; width: 10px; height: 10px; transform: rotate(45deg); background: var(--accent); }
.port:hover { text-decoration: underline; }

.caption { margin-top: 12px; font-size: 16px; font-style: italic; color: var(--muted); }

/* Plates */
.plate { display: flex; flex-direction: column; gap: 14px; }
.plate-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 4px 16px; }
.plate-head h2 { font: 400 40px/1.05 var(--fell); }
.plate-head h2:focus { outline: none; } /* focused by script to announce the plate; not a control */
.plate-intro { font-size: 18px; max-width: 62ch; }
.plate-map { max-width: 700px; width: calc(100% - 12px); }
.plate-corner { position: absolute; right: 14px; bottom: 8px; font-size: 12px; color: var(--muted); }

.pin { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; z-index: 2; border-radius: 50%; }
.pin span { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 400 14px/1 var(--serif); display: flex; align-items: center; justify-content: center; border: 2px solid var(--paper); }
.pin.wip span { background: var(--paper); color: var(--ink); border: 1.5px dashed var(--ink); }
a.pin:hover span, .pin.hl span { background: var(--accent); color: var(--paper); border-color: var(--paper); }
.pin.wip.hl span { border: 1.5px dashed var(--accent); background: var(--paper); color: var(--accent); }
.plbl { position: absolute; transform: translate(16px, -50%); font: italic 400 16px/1.1 var(--serif); white-space: nowrap; pointer-events: none; color: var(--ink); z-index: 1; text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper); }
.plbl.left { transform: translate(calc(-100% - 16px), -50%); }

.key { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 24px; margin-top: 8px; }
.entry { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--ink); padding: 10px 10px 4px; scroll-margin-top: 16px; transition: background var(--fade); }
.entry:focus { outline: none; }
.entry.hl { background: var(--paper); border-top: 2px solid var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.entry-head { display: flex; gap: 10px; align-items: baseline; }
.entry-head .n { font-family: var(--fell-sc); font-size: 14px; color: var(--muted); }
.entry h3 { font-size: 21px; font-weight: 500; line-height: 1.25; }
.entry p { font-size: 17px; line-height: 1.5; }
.entry .ashore { font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; align-self: flex-start; }
.entry .charting-note { font-size: 15px; font-style: italic; color: var(--muted); padding: 8px 0; }
.routes { display: flex; flex-direction: column; }
.route { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-style: italic; text-decoration: none; align-self: flex-start; }
.route .dots { width: 42px; border-top: 2px dotted var(--accent); flex: none; }
.route:hover .txt { text-decoration: underline; }

/* Plain list */
.plain { background: var(--paper); border: 1px solid var(--edge); padding: 26px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 12px; }
.plain:focus { outline: none; }
.js .plain { display: none; }
.js .atlas.is-plain .plain { display: flex; }
.plain h2 { font: 400 28px/1.15 var(--fell); }
.plain-lead { font-style: italic; color: var(--muted); }
.plain-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.plain-group h3 { font-size: 14px; border-bottom: 1px solid var(--ink); padding-bottom: 5px; margin-bottom: 4px; }
.plain-group li { font-size: 17px; }
.plain-group a { display: inline-flex; align-items: center; min-height: 44px; }
.plain-group .charting { display: inline-flex; align-items: center; min-height: 44px; font-style: italic; color: var(--muted); }

/* Writing */
.writing, .about { border-top: 1px solid var(--ink); padding-top: 28px; scroll-margin-top: 12px; }
.writing { display: flex; flex-direction: column; gap: 6px; }
.writing h2, .about h2 { font: 400 34px/1.1 var(--fell); }
.lead { font-size: 17px; color: var(--muted); font-style: italic; }
.harbours { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px 40px; margin-top: 18px; }
.harbour { display: flex; flex-direction: column; gap: 6px; }
.harbour h3 { font-size: 21px; }
.harbour .desc { font-size: 17px; color: #4E463B; margin-bottom: 4px; }
.posts a { display: flex; align-items: center; min-height: 44px; padding: 8px 0; border-bottom: 1px dotted var(--dots); text-decoration: none; color: var(--ink); font-size: 18px; line-height: 1.3; }
.posts a:hover { color: var(--accent); }
.posts:empty { display: none; }
.subscribe { font-size: 16px; min-height: 44px; display: inline-flex; align-items: center; align-self: flex-start; }

/* About */
.about { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.about-head { flex: 1 1 200px; }
.about-body { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; font-size: 19px; line-height: 1.6; }
.profiles { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 17px; }
.profiles a { min-height: 44px; display: inline-flex; align-items: center; }

/* Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; font-size: 15px; color: var(--muted); font-style: italic; border-top: 1px solid var(--ink); padding-top: 16px; }

/* Phone */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .page { gap: 28px; padding-top: 12px; }
  main { gap: 36px; }
  .masthead { padding-bottom: 6px; }
  .doors { gap: 0 14px; font-size: 16px; }
  .title-page { gap: 6px; padding-top: 0; }
  .title-page h1 { font-size: 48px; }
  .intro { font-size: 18px; }
  .rule { margin: 4px 0; }
  .js .atlas-app { gap: 24px; }
  .js .atlas-app { flex-direction: column; align-items: stretch; }
  .contents-col { display: contents; }
  .contents-title { order: 1; }
  .contents { order: 2; margin-top: -24px; }
  .view { order: 3; flex-basis: auto; }
  .bottle { order: 4; margin-top: 0; }
  .cartouche, .plbl, .isle small { display: none; }
  .isle { font-size: 11px; letter-spacing: .06em; padding: 4px 6px; max-width: 34%; }
  .port { font-size: 12px; }
  .caption { font-size: 15px; }
  .plate-head h2 { font-size: 32px; }
  .plain { padding: 18px; }
  .about-body { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --fade: 0ms; }
  .view.fade { animation: none; }
  html { scroll-behavior: auto; }
}

@media print {
  .masthead nav, .skip, .down, .bottle, .js .atlas-app { display: none !important; }
  .js .plain { display: flex !important; }
  body { background: #fff; }
}
